Troubleshooting
Symptom-to-fix guide for the most common problems running Anvio locally and in a Level 3+ stack.
2 min read
This page covers the failures you are most likely to hit day to day. Each entry follows a symptom → diagnosis → fix shape. For a categorized list of error messages see Common Errors; for production outages see Incident Response.
Health checks
Before diagnosing anything deeper, confirm the core services respond (Level 3+):
curl -f http://localhost:3000/health # API liveness
curl -f http://localhost:8222/healthz # NATS (JetStream monitoring port)At Level 1 there are no services to check — Anvio runs entirely against the filesystem.
NATS connection refused
Symptom. The worker or gateway logs connection refused on startup, or events never fire.
Diagnosis. NATS isn't running, or NATS_URL points at the wrong host.
Fix. Bring the dev stack up and confirm the URL:
docker compose -f docker/docker-compose.dev.yml up -d
curl -f http://localhost:8222/healthzNATS_URL defaults to nats://localhost:4222. NATS is only required at
Level 3+ — at Levels 1–2 the
in-process event bus is used and no broker is needed.
Anthropic (or other provider) API errors
Symptom. Model calls fail with 401/403, or invalid x-api-key.
Diagnosis. A missing or wrong provider key, or an API key colliding with a vendor-CLI runtime.
Fix.
- Verify the relevant key in
.env(e.g.ANTHROPIC_API_KEY,OPENAI_API_KEY). See Environment Variables for the full list. - If you use the
claude-coderuntime, do not also setANTHROPIC_API_KEY— the API key shadows the OAuth token and bills your subscription quota as API credits. See Runtime OAuth.
API key vs runtime OAuth
These are two different auth systems. Direct model calls use provider API keys; vendor-CLI
runtimes (Claude Code, Cursor, Codex, Antigravity) use OAuth tokens from anvio setup-token.
Mixing them is the single most common configuration mistake.
Database migration failures
Symptom. pnpm db:migrate fails, or the API can't reach Postgres.
Diagnosis. Wrong DATABASE_URL or an unhealthy Postgres container.
Fix.
docker compose -f docker/docker-compose.dev.yml up -d postgres
# wait for the container to report healthy, then:
pnpm db:migrate && pnpm db:seedConfirm DATABASE_URL matches the compose credentials (default DB/user/password anvio). See
Migrations.
MCP tools not appearing or repeatedly restarting
Symptom. An MCP server's tools never show up, or anvio_mcp_restarts_total climbs (see
Metrics).
Diagnosis. The MCP server command is wrong, its credentials are missing, or the first-call approval gate is blocking it.
Fix. Check server health and the setup flow:
anvio mcp healthThen re-check the preset config and required env vars per the
MCP Setup Guide. For local development against integrations
without live credentials, use the ANVIO_*_MOCK env flags (e.g. ANVIO_HONCHO_MOCK=1).
Fresh clone won't build or run
Symptom. Import or type errors immediately after cloning.
Fix. Anvio is a pnpm + Turborepo monorepo; packages must be built before apps run:
pnpm install
pnpm buildSee Local Development for the full setup.
Last updated on