Troubleshooting
First steps with structam doctor, and what to do when the server does not start, readiness fails, agents are refused, the install script stops or the UI misbehaves.
On this page
Status. Written from the product's error messages and the behaviour tested in its packages and in the compose and installer runs. Each entry names what you see, why, and what to do.
First steps
structam doctor # configuration, secret key, database (version, primary), clock skew, migrations,
# schema, public URL and its certificate, LDAP, OIDC, NetBox, InfraDB, sinks, licence
journalctl -u structam-all -f # or structam-serve / structam-worker; docker compose logs -f appstructam doctor changes nothing. Run it on the node with the node's environment: on an installed server set -a; . /etc/structam/structam.env; set +a; runuser -u structam -- structam doctor; with compose docker compose exec app structam doctor.
For more detail set STRUCTAM_LOG_LEVEL=debug (in /etc/structam/structam.env, deploy/compose/structam.env or the ConfigMap) and restart the node. Every API error carries a request_id; 5xx answers are logged with it.
System → Nodes shows every node's version, role, draining state, configuration hash (mismatches flagged) and the lease holders; System → Queues the queues, workers and dead jobs.
The server does not start
| Message (abridged) | Cause and fix |
|---|---|
STRUCTAM_DATABASE_URL is required / STRUCTAM_SECRET_KEY is required | the two mandatory settings. Every problem with a variable names it, and all are listed at once |
STRUCTAM_X and STRUCTAM_X_FILE are both set: keep one | set a secret one way only |
STRUCTAM_PUBLIC_URL must be https:// | agents and cookies need TLS. STRUCTAM_INSECURE_DEV=on is for local development only |
connect to database (check STRUCTAM_DATABASE_URL and that the primary is reachable) | network, credentials, or no primary among the hosts. The roles exit with it only for a refused password, an unknown database or a malformed URL; while the database is merely unreachable they log the database is not reachable: waiting for it and start once it answers |
STRUCTAM_SECRET_KEY looks weak (...) | the key looks chosen by a person (plain text, repeats, few distinct bytes). Generate one with openssl rand -base64 32 and rotate to it (rotating the secret key) |
N schema migrations are pending ... and STRUCTAM_MIGRATE=off: run structam migrate | a cluster node of a new release before its migration (upgrading) |
the schema needs a newer release (schema_compat) | this binary is older than the database allows: install the newer release |
the server identity key ... cannot be opened with STRUCTAM_SECRET_KEY | the secret key differs from the one the database was created with. Set the right key; never work around it (backup and restore) |
listen on :8080 (STRUCTAM_HTTP_ADDR): address already in use | another process, or a second role unit, holds the port |
STRUCTAM_AGENT_CA_FILE: ... | the file must hold PEM certificates only |
Under systemd a process that fails 10 times in 5 minutes is not restarted again: run systemctl reset-failed structam-all after fixing the cause. Waiting for an unreachable database is not a failure, so a database outage alone never leaves a unit in this state.
/readyz answers 503
Readiness means: the primary answers within 2 s, the schema is compatible, and the node is not draining. 503 while /livez answers 200 means the node is fine and waiting: check the database (and whether it is in recovery), or whether the node is stopping. During start-up the body names the phase (waiting for the database, preparing the schema, starting the components). Nothing restarts on readiness.
Writes answering 503 busy with Retry-After mean commits are stalled on a synchronous standby (commit stalls).
Agents
The agent logs to journalctl -u structam-agent (Linux), /Library/Logs/structam-agent.log (macOS) or agent.log in its state directory (Windows); structam-agent status shows its fingerprint and connection.
| What the agent reports | Cause and fix |
|---|---|
HTTP 404 on /agent/v1/connect | the admission stamp (Structam-Admission header) was missing, stale (clock more than 300 s off) or already used. If a proxy strips the header, fix the proxy; STRUCTAM_AGENT_ADMISSION=log for a short while records the refusals without enforcing them, to find it |
close 4003 not enrolled; a join token is required | a new key without a join token: install with a token |
close 4003 not enrolled; the join token is unknown, expired, used up, revoked or its proof failed | make a new token |
close 4003 duplicate agent identity (cloned image?) | a known key on a different machine. Run structam-agent reset-identity on the clone and enrol it with a token; build images with --image (golden images) |
close 4003 revoked; this key can never enrol again ... | run structam-agent reset-identity (root) and enrol with a new token |
| close 4001 | the node is draining; the agent reconnects to another at once |
acknowledgements busy or retry_after | the ingest queue is above STRUCTAM_INGEST_MAX_QUEUE or commits are stalled; the agent keeps the data on disk (backpressure) |
| refuses the server's identity | the server key is not the pinned one (a database restored without its secret key, a different installation); see structam server-key show |
| TLS errors | the host does not trust the public URL's certificate: save the CA under Add hosts → Private CA for agents and reinstall, or set STRUCTAM_CA_FILE |
An agent that is connected but shows old data: look at System → Queues for a backlog or dead jobs. A dead job never replays; its Retry asks the agent for a fresh report of those sections. Resync on an agent asks for a full report.
Enrolments refused with licence_restricted or licence_limit: the licence is restricted, or the agent limit (25 in evaluation) is reached (licensing). Enrolled agents keep reporting.
The install script stops
| Symptom | Fix |
|---|---|
| the manifest is not signed, or the key id is unknown | the server carries no build signed with a key the script knows. The KazLabs release key is not generated yet, so today only --allow-unsigned installs (printed and audited) |
| OpenSSL 3 is needed to verify | install OpenSSL 3 (openssl version), or accept trust in TLS with --allow-unsigned |
| curl exit 60 (certificate problem) | the host does not trust the server's certificate and no private CA is saved: Add hosts → Private CA for agents |
| the pin in the token differs from the server's | the token is from another installation, or the server key was rotated after the token was made: make a new token |
| not connected within 60 s | check the agent log on the host, and that the host reaches the public URL on 443 |
The web UI
- Live updates stop (lists do not refresh): a proxy buffers the event stream (
/api/v1/stream). Turn buffering off for it (flush_interval -1in Caddy,proxy_buffering offin nginx). - 403 on every change, but sign-in works: the request's
Originis not the public URL. Users must useSTRUCTAM_PUBLIC_URLexactly, or add the other origin toSTRUCTAM_ALLOWED_ORIGINS. - Every request comes from the proxy's address in the audit log and rate limits: add the proxy to
STRUCTAM_TRUSTED_PROXIES. - Locked out:
structam user unlock -username NAME; with no administrator left,structam user create -username NAME -adminon a server.
Integrations
- NetBox:
structam netbox testandstructam netbox status. A run with statusrefusedis the prune guard (sync). If NetBox's rq workers do not run, NetBox sends no webhooks; the poll still finds every change. - SIEM: a parked sink shows its last error on Integrations → SIEM and TAXII; it retries every 5 minutes and clears when saved.
- Background tasks not running: System → Nodes shows each task's holder, last run and last error, and lets you run, pause or resume a task.
Questions the docs do not answer?
Ask the people who build Structam. Installation media and licences come from KazLabs.