infra/scripts/ and the
monitoring profile (Observability). Every command
runs from the repository checkout on the host, against one stack:
1. Detect
An incident starts with one of three signals:
Confirm what is firing, rather than what one person saw:
2. Triage
Answer three questions in order, because the order decides the fix.- Did a deploy just happen? If the incident began within minutes of
deploy.sh, assume the release until shown otherwise and go to step 3.deploy.shprinted the previous images; they are also in the shell history. - What is not running?
$C psshows each service’s state.Restartingmeans it starts and exits:$C logs --tail 50 <service>names the reason. - Is it a dependency?
/readynames the database and the cache. PostgreSQL down stops the API; Redis down only slows scans (the worker polls PostgreSQL instead) and does not need a rollback. A full disk on the worker fails scans with “the scanning worker ran out of disk space”: free space, and they are retried.
3. Roll back a release
rollback.sh puts the previous images back and leaves the schema alone. Use
the exact command deploy.sh printed: at the end of a successful deploy
(to roll back: infra/scripts/rollback.sh --to-backend '…' --to-dashboard '…')
or at the gate that stopped it (Roll back with: infra/scripts/rollback.sh --to-backend '…').
deploy.sh took before migrating (*-pre-deploy.dump.age
in BACKUP_DIR) with infra/scripts/restore.sh, as
Backup and recovery describes.
4. Verify, then close
Rehearsal, 2026-11-11
Run on a local stack built from this repository: the production Compose file, PostgreSQL, Redis, the API and the worker on a locally built backend image, three organizations, and the monitoring profile on. The “bad release” was the same image with an API that exits at start with a configuration error.
Four minutes from the bad start to a serving API, most of it the health gate’s
wait. What the rehearsal did not cover: a real paging receiver (the example
Alertmanager file was used, so the alert reached nobody), the smoke test (no
public URL), and a release whose migration forces a restore.