Incident Response
A practical playbook for diagnosing and recovering a Level 3+ Anvio deployment during an outage.
2 min read
This playbook applies to a Level 3+ deployment (API + worker + gateway backed by Postgres, Redis, and NATS). At Levels 1–2 there is no shared infrastructure to fail — recovery is a local concern covered by Troubleshooting.
1. Assess scope
Hit the health endpoints to localize the failure fast:
curl -f http://localhost:3000/health # API
curl -f http://localhost:8222/healthz # NATS
docker compose ps # container states| Failing check | Likely blast radius |
|---|---|
API /health down | Inbound requests and channel webhooks rejected |
NATS /healthz down | Detached/background runs stop; events stall |
| Postgres unhealthy | Session/message persistence and auth fail |
| Redis unhealthy | Short-term memory cache degraded (Level 3+) |
2. Stabilize
Restart the smallest failing unit first — a single service, not the whole stack:
docker compose -f docker/docker-compose.dev.yml restart <service>If the API is up but agents hang, the worker or its NATS
connection is the usual culprit — restart worker and re-check /healthz.
Protect subscription quota during an incident
Do not "temporarily" add ANTHROPIC_API_KEY to get models working again if you run the
claude-code runtime — it silently redirects usage to metered API billing. Fix the OAuth token
instead. See Runtime OAuth.
3. Diagnose with the signals you already emit
- Cost/usage spike or MCP thrash — inspect
GET /api/metrics(anvio_token_cost_usd_total,anvio_mcp_restarts_total). - Latency or error clustering — inspect traces in your OTLP backend.
- Tool/runtime failures — check the audit logs (
anvio audit executions) andanvio mcp health.
4. Recover data
Sessions and messages live in Postgres at Level 3+; workspace artifacts (agents, skills, goals, kanban) are files. If a workspace file was corrupted or deleted and the workspace is under git, restore it from history:
git -C workspace checkout -- goals/project-refactor.yamlThere is no soft-delete for workspace files — git history is the recovery mechanism.
5. Write it down
Anvio does not ship an incident-tracking tool. Capture the timeline, root cause, and follow-ups
wherever your team already tracks incidents. If the root cause was an unclassified
INTERNAL_ERROR (see Common Errors), attach the stack trace to a
repository issue so it can be classified properly.
TODO: Add deployment-specific escalation contacts, on-call rotation, and SLOs here — those are environment-specific and not defined in the Anvio source repo.
Last updated on