Error catalogue
Superseded for scope. The authoritative taxonomy is
docs/architecture/OBSERVABILITY-ERROR-TAXONOMY.md; the codes defined here are preserved there.
Machine-readable block at the end is the source of truth; the table explains it. Every code is stable, greppable and mapped to a runbook or an explicit "no action".
Classification follows the audit's three-way retry model:
- retryable — the same attempt may succeed with no new external effect.
- not-retryable — retrying cannot fix it (validation, policy, config).
- uncertain — an external effect may or may not have happened; never auto-retry.
| Code | Subsystem | Stage | Class | Retry | User sees | Persisted state |
|---|---|---|---|---|---|---|
AUTH_NO_SESSION | http/auth | request | auth | no | "Sign in again" | nothing |
AUTH_INVALID_TOKEN | http/auth | request | auth | no | "Sign in again" | nothing |
AUTH_OWNER_MISSING | http/auth | resolve | auth | no | "Account not initialised" | nothing |
CONTRACT_UNKNOWN_ROUTE | http | request | validation | no | "Not found" | nothing |
VALIDATION_INVALID_INPUT | http | request | validation | no | field message | nothing |
RATE_LIMITED | http | request | quota | yes (after) | "Slow down" | nothing |
CAP_SEARCH_REACHED | platform/limits | pre-dispatch | quota | no (until UTC reset) | "20 searches/day" | ledger unchanged |
CAP_FETCH_REACHED | platform/limits | pre-dispatch | quota | no | "source budget spent" | ledger unchanged |
SEARCH_ACTIVE | features/searches | pre-dispatch | conflict | no | "Search already running" | existing search intact |
NOT_EXECUTABLE_SOURCE | features/searches | pre-dispatch | policy/config | no | blocked/not-configured reason | nothing charged |
QUEUE_NOT_CONFIGURED | platform/queue | pre-dispatch | config | no | "search cannot start" | search failed, cap released |
QUEUE_PUBLISH_FAILED | platform/queue | producer | upstream | yes | "try again" | search failed, cap released |
QUEUE_FORGED_MESSAGE | consumer | claim | security | no | — | nothing; message acked |
QUEUE_DUPLICATE_DELIVERY | consumer | claim | idempotency | no | — | counts as success |
QUEUE_ATTEMPTS_EXHAUSTED | consumer | settle | internal | no | "search failed" | search failed |
QUEUE_DEAD_LETTERED | consumer | settle | internal | operator | "search failed" | DLQ message + search failed |
TASK_LEASE_STUCK | consumer | claim | internal | operator | "search still running" | search running + lease |
SCRAPER_DEPENDENCY_MISSING | scraperClient | dispatch | config | no | "source unavailable" | held, uncharged |
SCRAPER_BUDGET_EXHAUSTED | scraperClient | dispatch | quota | no | "source budget spent" | held, uncharged |
SCRAPER_CREDENTIAL_REJECTED | scraperClient | dispatch | config | no | "source unavailable" | held, uncharged |
SCRAPER_RATE_LIMITED | scraperClient | response | upstream | yes | "source busy" | failed/held |
SCRAPER_UPSTREAM_502 | scraperClient | response | upstream | yes | "source failed" | failed |
SCRAPER_TIMEOUT | scraperClient | response | upstream | uncertain | "source timed out" | failed + uncertain marker (new) |
SCRAPER_BAD_RESPONSE | scraperClient | validate | upstream | yes (bounded) | "source failed" | failed |
SCRAPER_SOURCE_BLOCKED | scraperClient | response | policy | no | "source blocked" | failed |
SCRAPER_EMPTY_BOARD | scraperClient | response | upstream | no | "no openings" | empty (not a failure) |
CANONICAL_INVALID_RECORD | ingest | validate | validation | no | — | row skipped, counted |
CANONICAL_WRONG_SOURCE | ingest | validate | validation | no | — | row skipped, counted |
INGEST_BOUND_REACHED | ingest | ingest | quota | no | "truncated" | truncated: true |
D1_CONSTRAINT | platform/db | write | db | no | "could not save" | batch rolled back |
D1_UNIQUE_CONFLICT | platform/db | write | db | no (dedupe handles) | — | upsert path |
D1_STATEMENT_LIMIT | platform/db | write | db | yes (smaller chunk) | "could not save" | batch rolled back |
D1_QUERY_TIMEOUT | platform/db | read/write | db | yes | "try again" | unchanged |
D1_BATCH_FAILED | platform/db | write | db | yes | "could not save" | partial — see runbook |
R2_UPLOAD_FAILED | platform/storage | upload | storage | yes | "upload failed" | no object |
R2_OBJECT_MISSING | platform/storage | download | storage | no | "file unavailable" | row points at missing key |
R2_DELETE_INCOMPLETE | platform/storage | erasure | storage | yes | — | rows retained (correct order) |
AI_NOT_CONFIGURED | platform/ai | pre-call | config | no | "AI unavailable" | nothing |
AI_PROVIDER_TIMEOUT | platform/ai | call | upstream | yes (bounded) | "AI timed out" | budget settled |
AI_RATE_LIMITED | platform/ai | call | quota | yes (after) | "AI busy" | retryAfterMs |
AI_MALFORMED_RESPONSE | platform/ai | validate | upstream | yes (once) | "AI failed" | nothing persisted |
GMAIL_SCOPE_INVALID | outreach | pre-send | auth | no | "reconnect Gmail" | draft unchanged |
GMAIL_REFRESH_FAILED | outreach | pre-send | auth | yes (once) | "reconnect Gmail" | draft unchanged |
GMAIL_REJECTED | outreach | send | upstream | no | "not sent" | failed, cap refunded |
GMAIL_TIMEOUT | outreach | send | upstream | uncertain | "unconfirmed" | unknown, cap kept |
CONFIG_BINDING_MISSING | platform/env | boot | config | no | 503 naming the binding | nothing |
CONFIG_SECRET_MISSING | platform/env | boot | config | no | 503 naming the surface | nothing |
RETENTION_SWEEP_FAILED | scheduled | cron | internal | yes (next run) | — | nothing deleted |
ERASURE_INCOMPLETE | account | erasure | internal | yes | "erasure unfinished" | rows retained |
{
"version": 1,
"codes": [
{"code":"AUTH_NO_SESSION","subsystem":"http.auth","stage":"request","class":"auth","retry":"not-retryable","http":401,"runbook":"RB-10"},
{"code":"AUTH_INVALID_TOKEN","subsystem":"http.auth","stage":"request","class":"auth","retry":"not-retryable","http":401,"runbook":"RB-10"},
{"code":"AUTH_OWNER_MISSING","subsystem":"http.auth","stage":"resolve","class":"auth","retry":"not-retryable","http":403,"runbook":"RB-10"},
{"code":"CONTRACT_UNKNOWN_ROUTE","subsystem":"http","stage":"request","class":"validation","retry":"not-retryable","http":404,"runbook":null},
{"code":"VALIDATION_INVALID_INPUT","subsystem":"http","stage":"request","class":"validation","retry":"not-retryable","http":400,"runbook":null},
{"code":"RATE_LIMITED","subsystem":"http","stage":"request","class":"quota","retry":"retryable","http":429,"runbook":null},
{"code":"CAP_SEARCH_REACHED","subsystem":"platform.limits","stage":"pre-dispatch","class":"quota","retry":"not-retryable","http":429,"runbook":"RB-09"},
{"code":"CAP_FETCH_REACHED","subsystem":"platform.limits","stage":"pre-dispatch","class":"quota","retry":"not-retryable","http":429,"runbook":"RB-09"},
{"code":"SEARCH_ACTIVE","subsystem":"features.searches","stage":"pre-dispatch","class":"conflict","retry":"not-retryable","http":409,"runbook":"RB-03"},
{"code":"NOT_EXECUTABLE_SOURCE","subsystem":"features.searches","stage":"pre-dispatch","class":"policy","retry":"not-retryable","http":400,"runbook":null},
{"code":"QUEUE_NOT_CONFIGURED","subsystem":"platform.queue","stage":"pre-dispatch","class":"config","retry":"not-retryable","http":503,"runbook":"RB-08"},
{"code":"QUEUE_PUBLISH_FAILED","subsystem":"platform.queue","stage":"producer","class":"upstream","retry":"retryable","http":503,"runbook":"RB-02"},
{"code":"QUEUE_FORGED_MESSAGE","subsystem":"consumer","stage":"claim","class":"security","retry":"not-retryable","http":null,"runbook":"RB-12"},
{"code":"QUEUE_DUPLICATE_DELIVERY","subsystem":"consumer","stage":"claim","class":"idempotency","retry":"not-retryable","http":null,"runbook":null},
{"code":"QUEUE_ATTEMPTS_EXHAUSTED","subsystem":"consumer","stage":"settle","class":"internal","retry":"not-retryable","http":null,"runbook":"RB-02"},
{"code":"QUEUE_DEAD_LETTERED","subsystem":"consumer","stage":"settle","class":"internal","retry":"operator","http":null,"runbook":"RB-05"},
{"code":"TASK_LEASE_STUCK","subsystem":"consumer","stage":"claim","class":"internal","retry":"operator","http":null,"runbook":"RB-03"},
{"code":"SCRAPER_DEPENDENCY_MISSING","subsystem":"scraperClient","stage":"dispatch","class":"config","retry":"not-retryable","http":503,"runbook":"RB-08"},
{"code":"SCRAPER_BUDGET_EXHAUSTED","subsystem":"scraperClient","stage":"dispatch","class":"quota","retry":"not-retryable","http":402,"runbook":"RB-09"},
{"code":"SCRAPER_CREDENTIAL_REJECTED","subsystem":"scraperClient","stage":"dispatch","class":"config","retry":"not-retryable","http":401,"runbook":"RB-08"},
{"code":"SCRAPER_RATE_LIMITED","subsystem":"scraperClient","stage":"response","class":"upstream","retry":"retryable","http":429,"runbook":"RB-04"},
{"code":"SCRAPER_UPSTREAM_502","subsystem":"scraperClient","stage":"response","class":"upstream","retry":"retryable","http":502,"runbook":"RB-04"},
{"code":"SCRAPER_TIMEOUT","subsystem":"scraperClient","stage":"response","class":"upstream","retry":"uncertain","http":504,"runbook":"RB-06"},
{"code":"SCRAPER_BAD_RESPONSE","subsystem":"scraperClient","stage":"validate","class":"upstream","retry":"retryable","http":502,"runbook":"RB-04"},
{"code":"SCRAPER_SOURCE_BLOCKED","subsystem":"scraperClient","stage":"response","class":"policy","retry":"not-retryable","http":403,"runbook":"RB-07"},
{"code":"SCRAPER_EMPTY_BOARD","subsystem":"scraperClient","stage":"response","class":"upstream","retry":"not-retryable","http":200,"runbook":null},
{"code":"CANONICAL_INVALID_RECORD","subsystem":"ingest","stage":"validate","class":"validation","retry":"not-retryable","http":null,"runbook":null},
{"code":"CANONICAL_WRONG_SOURCE","subsystem":"ingest","stage":"validate","class":"validation","retry":"not-retryable","http":null,"runbook":null},
{"code":"INGEST_BOUND_REACHED","subsystem":"ingest","stage":"ingest","class":"quota","retry":"not-retryable","http":null,"runbook":null},
{"code":"D1_CONSTRAINT","subsystem":"platform.db","stage":"write","class":"db","retry":"not-retryable","http":500,"runbook":"RB-11"},
{"code":"D1_UNIQUE_CONFLICT","subsystem":"platform.db","stage":"write","class":"db","retry":"not-retryable","http":null,"runbook":"RB-11"},
{"code":"D1_STATEMENT_LIMIT","subsystem":"platform.db","stage":"write","class":"db","retry":"retryable","http":500,"runbook":"RB-11"},
{"code":"D1_QUERY_TIMEOUT","subsystem":"platform.db","stage":"read","class":"db","retry":"retryable","http":504,"runbook":"RB-11"},
{"code":"D1_BATCH_FAILED","subsystem":"platform.db","stage":"write","class":"db","retry":"retryable","http":500,"runbook":"RB-11"},
{"code":"R2_UPLOAD_FAILED","subsystem":"platform.storage","stage":"upload","class":"storage","retry":"retryable","http":502,"runbook":"RB-13"},
{"code":"R2_OBJECT_MISSING","subsystem":"platform.storage","stage":"download","class":"storage","retry":"not-retryable","http":404,"runbook":"RB-13"},
{"code":"R2_DELETE_INCOMPLETE","subsystem":"platform.storage","stage":"erasure","class":"storage","retry":"retryable","http":null,"runbook":"RB-14"},
{"code":"AI_NOT_CONFIGURED","subsystem":"platform.ai","stage":"pre-call","class":"config","retry":"not-retryable","http":503,"runbook":"RB-08"},
{"code":"AI_PROVIDER_TIMEOUT","subsystem":"platform.ai","stage":"call","class":"upstream","retry":"retryable","http":504,"runbook":"RB-15"},
{"code":"AI_RATE_LIMITED","subsystem":"platform.ai","stage":"call","class":"quota","retry":"retryable","http":429,"runbook":"RB-15"},
{"code":"AI_MALFORMED_RESPONSE","subsystem":"platform.ai","stage":"validate","class":"upstream","retry":"retryable","http":502,"runbook":"RB-15"},
{"code":"GMAIL_SCOPE_INVALID","subsystem":"outreach","stage":"pre-send","class":"auth","retry":"not-retryable","http":409,"runbook":"RB-16"},
{"code":"GMAIL_REFRESH_FAILED","subsystem":"outreach","stage":"pre-send","class":"auth","retry":"retryable","http":409,"runbook":"RB-16"},
{"code":"GMAIL_REJECTED","subsystem":"outreach","stage":"send","class":"upstream","retry":"not-retryable","http":502,"runbook":"RB-16"},
{"code":"GMAIL_TIMEOUT","subsystem":"outreach","stage":"send","class":"upstream","retry":"uncertain","http":504,"runbook":"RB-16"},
{"code":"CONFIG_BINDING_MISSING","subsystem":"platform.env","stage":"boot","class":"config","retry":"not-retryable","http":503,"runbook":"RB-08"},
{"code":"CONFIG_SECRET_MISSING","subsystem":"platform.env","stage":"boot","class":"config","retry":"not-retryable","http":503,"runbook":"RB-08"},
{"code":"RETENTION_SWEEP_FAILED","subsystem":"scheduled","stage":"cron","class":"internal","retry":"retryable","http":null,"runbook":"RB-17"},
{"code":"ERASURE_INCOMPLETE","subsystem":"account","stage":"erasure","class":"internal","retry":"retryable","http":null,"runbook":"RB-14"}
]
}Rules
- A new failure without a code is a defect: the code is what the runbook, the alert and the test key on.
uncertaincodes are the only place where "did it happen?" is legitimate. Every other code must be resolvable from persisted state.- Codes are part of the API error envelope (
{ok:false, code, message}) — additive, so existing clients keep working.