Common Issues and Solutions
Use this page as a practical runbook for local development and CI.
First commands to run:
docker compose psdocker compose logs --tail=200 --no-color spx-server
docker compose up fails (container conflicts / compose not installed)
docker compose up fails (container conflicts / compose not installed)Symptom:
docker: Error response from daemon: Conflict. The container name "/spx-server" is already in useordocker compose: command not found.Likely cause: leftover containers from a previous run, or Docker Compose v2 is not installed/enabled.
Fix:
Stop/remove old containers:
docker compose down --remove-orphansIf the name is still taken:
docker rm -f spx-serverVerify compose is available:
docker compose version
Installer wizard fails to start (spx-install.sh / spx-install.ps1)
spx-install.sh / spx-install.ps1)Symptom: the installer exits with missing Python modules or cannot find
docker.Likely cause: Python or pip is missing, or the required modules are not installed.
Fix:
Verify Python and pip:
python --versionandpython -m pip --versionInstall modules:
python -m pip install --user pyyaml coloramaIf you need a custom interpreter, set
PYTHON_BINbefore running the installer.
spx-start fails with missing Python modules
spx-start fails with missing Python modulesSymptom:
spx-startreports missingrequestsorspx_python.Likely cause: required Python modules are not installed for the interpreter used by the script.
Fix:
Install dependencies:
python -m pip install --user requests spx-pythonSet
PYTHON_BINto the correct interpreter and re-runspx-start.
BLE adapter not running in installer bundles
Symptom: BLE models fail and the start script prints
npm not available; skipping BLE adapter start.Likely cause: Node.js and npm are missing, or the BLE adapter was not installed.
Fix:
Install Node.js and re-run
spx-start, orRegenerate the bundle without BLE services if you do not need them.
PowerShell scripts blocked by execution policy
Symptom: Windows refuses to run
spx-install.ps1orspx-start.ps1.Likely cause: PowerShell execution policy prevents running local scripts.
Fix:
Run with
pwsh -ExecutionPolicy Bypass -File spx-install.ps1Do the same for
spx-start.ps1if needed.
SPX Server is not reachable on http://localhost:8000
http://localhost:8000Symptom: browser/curl returns “connection refused” or times out.
Likely cause: the container is not running, the API port is not mapped, or port
8000is already used by another process.Fix:
Check container status:
docker compose psCheck logs:
docker compose logs --tail=200 --no-color spx-serverIf you changed the host port (e.g.
18000:8000), point clients at the new URL:set
SPX_BASE_URL=http://localhost:18000
API calls fail with auth errors (401/403) or tests fail early
401/403) or tests fail earlySymptom: endpoints reject requests; tests fail before any model logic runs.
Likely cause:
SPX_PRODUCT_KEYis missing/invalid.Fix:
Local: export
SPX_PRODUCT_KEY(or put it in.envso Compose picks it up).Installer bundles: update
.envin the generated folder (it defaults toREPLACE_ME).CI: store
SPX_PRODUCT_KEYas a secret and inject it in the job env (see CI/CD Setup (GitHub Actions)).
Model load fails with 422 / validation errors
422 / validation errorsSymptom: loading a Model via API returns
422(or server logs showValidationErrorpaths).Likely cause: YAML shape does not match the expected schema (missing keys, wrong list vs mapping), or the model references an unregistered custom class/action.
Fix:
Inspect the server error details:
docker compose logs --tail=200 --no-color spx-serverIf you are authoring in
spx-examples, run its validator before starting the server:python tools/validate_models.pyFor SDK schema rules, see: Validation
Tests are flaky / non-deterministic
Symptom: the same MiL test sometimes passes and sometimes fails.
Likely cause: wall-clock sleeps, nondeterministic randomness, or background loops that advance state outside the test’s control.
Fix:
Drive time explicitly from tests (MiL): set timer attributes (if present) and call
client.run()in a loop.Seed any RNG used by model logic during prepare-time.
Use Snapshots for stable starting states: Snapshots — Getting Started
Custom extensions not found (“unknown action/class”)
Symptom: errors like “unknown class”, “unknown action”, or import failures in logs.
Likely cause: the extension file is not mounted into the container, or the registry/modules were not reloaded.
Fix:
Ensure
./extensions(or your chosen folder) is mounted into the server container (see Installation Guide).Reload modules before creating new instances:
client.reload_modules()(see Extend with a Custom Component)Inspect import errors:
docker compose logs --tail=200 --no-color spx-server
“Adapter can’t reach host” (Docker networking)
Symptom: a protocol adapter or companion service (MQTT broker, BLE adapter, etc.) works on the host but fails from SPX running in Docker.
Likely cause:
127.0.0.1inside a container is not the host loopback.Fix:
Use
host.docker.internalas the host address (where supported), or run the service inside the same compose network.Ensure the service port is published on the host and the model points to it.
Protocol port not exposed (Modbus/SCPI/MQTT/etc.)
Symptom: the SUT cannot connect to the simulated device port.
Likely cause: the model enables a protocol adapter, but the host port is not mapped in
docker-compose.yml.Fix:
Confirm port mappings:
docker compose psUpdate
ports:indocker-compose.ymlto expose the required ports (see Communication Adapters).
BLE simulations fail to connect to the BLE adapter
Symptom: BLE models fail at startup or BLE operations time out.
Likely cause:
spx-ble-adapteris not running/reachable, or the model points at the wrong host/port.Fix:
Confirm the adapter is running and reachable on the configured port (default
8085in the adapter docs).Verify the model’s BLE configuration matches your deployment network (host vs container).
See: BLE Adapter
CI fails intermittently (“server not ready”)
Symptom: CI fails with connection errors right after
docker compose up -d.Likely cause: tests start before the server finishes booting.
Fix:
Add a readiness loop that polls
http://localhost:8000/before running tests (see CI/CD Setup (GitHub Actions)).
Last updated

