Troubleshooting

What commonly goes wrong when deploying OpenSeal, what the logs show for it, and how to fix it. Every service writes one JSON object per line, so most answers start with a grep.

First look

docker compose ps                                    # which service is not healthy, or restarting
docker compose logs --tail 50 SERVICE                # its last lines
docker compose logs | grep '"event":"start_failed"'  # why a service would not start

On the production profile add -f deploy/compose.production.yml (and the release's compose.release.yml) to every command. A service that does not start writes one start_failed line with the setting that failed in error and, when there is one, the error code in code:

{"ts":"2026-11-20T09:30:00Z","level":"ERROR","service":"worker","event":"start_failed","error":"…","code":"CS-KEY-0013"}

Error codes are listed in the error code registry. Logs never contain names, email addresses, client addresses, tokens or document text, so they are safe to share when you ask for help; still check before you paste.

The port is already in use

Symptom: docker compose up fails with Bind for 127.0.0.1:8080 failed: port is already allocated (or 8025 for Mailpit).

Fix: stop what holds the port, or move OpenSeal's: OPENSEAL_HTTP_PORT=8081 docker compose up -d --wait (OPENSEAL_MAIL_PORT for Mailpit). The evaluation stack's public URL follows OPENSEAL_HTTP_PORT, so links in emails stay right. Ports bind to 127.0.0.1 only; to reach the stack from another machine, put a TLS proxy in front.

docker compose up --wait never finishes

Look at docker compose ps: the service still starting or unhealthy is the cause, and its dependants wait for it.

  • migrate exited (1): the database was not reachable, or a migration failed. Its log names the migration. A restore target must be empty before migrate ever runs.
  • server unhealthy: read its start_failed line. The usual causes are a missing OPENSEAL_MFA_KEY outside development, an http:// public URL without the development switch, or a malformed key.
  • clamav starting: it loads its signatures for up to a few minutes after a start and needs about 1 GB of memory.
  • Production profile: keyd or worker restarting with CS-KEY-0014: the manifests are not recorded yet, or a setting changed. See below.

Compose says a variable is required

Symptom: required variable OPENSEAL_PUBLIC_URL is missing a value: set OPENSEAL_PUBLIC_URL (https).

Fix: the production profile refuses to render until every required variable is set. The configuration reference lists them; set them in your environment or an --env-file.

keyd or the worker refuses to start: CS-KEY-0014

Log: start_failed with "code":"CS-KEY-0014" naming a setting, and a security_configuration line whose manifest is not matches.

Cause: a security setting differs from the recorded manifest, is set but not listed, or is listed but not set. init-secrets.sh leaves both manifests empty, so this is expected until you record them. After a change you did not intend, find what changed first.

Fix: after an approved change, record the manifests again and restart:

docker compose $F run --rm --no-deps keyd config-manifest | sudo tee "$OPENSEAL_SECRETS_DIR/keyd-config-manifest" > /dev/null
docker compose $F run --rm --no-deps worker config-manifest | sudo tee "$OPENSEAL_SECRETS_DIR/worker-config-manifest" > /dev/null

keyd is unreachable: CS-KEY-0011

Log: the worker logs keyd_unavailable at start, and later transport.backend_failed with CS-KEY-0011; envelopes wait in completing; a seal_failed alert repeats.

Cause: keyd is stopped, still starting, or not on the worker's network (connection refused, reset or timed out, or the name does not resolve). This is treated as an outage: the worker keeps running every other job and retries the seal every 60 seconds.

Fix: bring keyd back (docker compose ps keyd, then its log). The next seal attempt completes the envelope; nothing needs to be re-sent.

keyd refuses the worker: CS-KEY-0013, CS-KEY-0001

Log: the worker stops at start with start_failed and CS-KEY-0013 (the TLS handshake was refused), or CS-KEY-0001 (keyd answered, but the caller is not on its allow list); keyd logs transport.caller_refused with reason handshake or not_allowed and the certificate's fingerprint.

Cause: a configuration error, not an outage: OPENSEAL_KEYD_CA is not the CA keyd's certificate chains to, OPENSEAL_KEYD_SERVER_NAME is not the name in keyd's certificate, or the worker's client certificate is untrusted, expired or missing from keyd-allow-list.

Fix: compare the fingerprint keyd logged with keyd-allow-list; check the certificates' dates with openssl x509 -noout -dates -in worker-client-chain.pem. After rotating an identity, record the manifests and restart keyd, then the worker.

keyd cannot use the HSM: CS-KEY-0003, CS-KEY-0006

Log: keyd's start_failed with CS-KEY-0003 (the HSM is unavailable, the PIN was refused, or a PKCS#11 call failed) or CS-KEY-0006 (no usable certificate, the key not found or ambiguous in the token, or the key does not match the certificate).

Fix: check that OPENSEAL_PKCS11_MODULE is inside OPENSEAL_PKCS11_DIR and loads in a slim Linux container, that the token label and key label are exact, that keyd-pkcs11-pin holds the PIN with no trailing newline your HSM rejects, that a network HSM is reachable from keyd's network, and that seal-chain.pem starts with the certificate of that key.

Seals fail with CS-KEY-0015

Log: keyd records CS-KEY-0015; the worker logs transport.backend_failed with that code and retries every 60 seconds.

Cause: keyd holds a seal token key and the database has none, a different one, or a clock more than five minutes from keyd's.

Fix: write the same key to keyd-seal-token-key and migrate-seal-token-key, run docker compose $F run --rm migrate (it installs the key), restart keyd, and keep both hosts' clocks on NTP.

The timestamp authority fails: CS-WRK-0018, CS-SEAL-0005

Log: transport.backend_failed with "backend":"tsa", the TSA's index in your list and a reason: connect, tls, timeout, status, answer or address_refused (the URL is never logged). The worker tries the next TSA in the list; when none answers, the seal fails and is retried.

  • connect, timeout: the worker cannot reach it. On the production profile only the worker has a route out, through the egress network; check your firewall.
  • tls: the TSA's HTTPS certificate does not verify.
  • answer or CS-SEAL-0005: the token is not usable. A TSA whose tokens identify its certificate with ESSCertID v1 (SHA-1), such as FreeTSA, is refused.
  • The seal is made but fails its own check: trust-anchors.pem lacks the TSA's root or the seal certificate's root. Add both.

Test a TSA before using it: OPENSEAL_INTEROP_NETWORK=1 python3 tools/interop/interop.py check --tsa-url URL --tsa-root ROOT.pem.

Emails are not delivered

  • Evaluation stack: nothing leaves the machine; every email is in Mailpit at http://localhost:8025.
  • Worker log shows SMTP errors: check OPENSEAL_SMTP_HOST, OPENSEAL_SMTP_PORT (587 for STARTTLS), the user and the smtp-password file. The profile sets OPENSEAL_SMTP_SECURITY=starttls, so the relay must offer STARTTLS.
  • Accepted by the relay but not received: look at SPF, DKIM and DMARC for the OPENSEAL_MAIL_FROM domain, and at the relay's bounce reports. A bounced invitation shows on the envelope's recipient.
  • Text-message or voice codes fail with CS-WRK-0013: no SMS gateway is configured (OPENSEAL_SMS_GATEWAY_URL).

An envelope stays in completing

Every signer has finished, but the envelope has not reached completed. The seal job is waiting on something; nothing sealed is served until it completes.

  • A seal_failed alert with CS-SEAL-0001 or CS-KEY-*: keyd, see above. The job retries every 60 seconds.
  • Retries with CS-BLOB-0001: the object store refuses writes.
  • CS-WRK-0020: a sandbox workspace's envelope, and no sandbox key is configured.
  • A job_dead alert: the job gave up on a failure no retry cures. Fix the cause, then queue it again as in docs/65 §Failure recovery; a seal already stored is read back, never made twice.

Uploads are refused

  • 413 CS-API-0006: over the size limit (50 MiB a document; 70 MiB request body). At your edge proxy, allow bodies up to 280 MB.
  • 422 CS-PDF-*: the PDF could not be admitted (encrypted without a password, too many pages, malformed); the code says which.
  • 422 CS-SCAN-0001: ClamAV found malware; recorded in the admin log as upload.malware_refused.
  • 503 CS-SCAN-0002: ClamAV could not answer (starting, unreachable, timed out). Wait for it to be healthy.

Signing in fails

  • Evaluation stack in a browser on another machine: the stack sends cookies over plain HTTP for localhost only. Use http://localhost:8080 on the same machine.
  • OAuth access tokens answer 401 CS-AUTH-0002 after a restart: the token signing key changed. Swapping it straight away invalidates every token it signed; rotate it with the previous key mounted (Rotations). Likewise never replace OPENSEAL_MFA_KEY or the password pepper without their runbooks.
  • The proxy's address is recorded instead of the client's: OPENSEAL_TRUSTED_PROXIES does not cover the edge network, or your edge does not send X-Forwarded-For.
  • 429 CS-API-0003: rate limited; ten sign-in attempts a minute per name. Wait for Retry-After.

Getting help

Open an issue on GitHub with the release, which stack, the start_failed or failing lines and the request id (X-Request-Id) of a failing API call. Report security problems privately, as the security policy says.