Error codes

Release status: 3.0.0 and develop
Every HTTP error is an RFC 9457 application/problem+json document with a stable code. On develop each catalogued code also names its owning module, a one-line hint and a runbook. Released 3.0.0 has RFC 9457 problem bodies, relata explain-error and relata_problem_responses_total{code}. The module and hint members, the module label, module error series, runbook links in the catalogue and relata_stat_errors are on develop. "On develop" means merged in the product repository but not in a release yet.

The shape of an error

MemberMeaning
typehttps://relatadb.dev/errors/<code> for a catalogued problem, or about:blank
title, status, detailSummary, HTTP status and the specific occurrence
codeStable machine-readable string, for example access-denied
moduleThe module that owns the code, such as acl, planner or wal
hintOne line on what to do
request_idThe correlation id; quote it when you ask for help
retryableWhether repeating the request can succeed without operator action
instanceThe request path, when present

Adding a code is not a breaking change; removing or renaming one is.

Look a code up

Online, open /errors/<code> on this site, or see the full table in Error codes.

Offline, on the node:

relata explain-error access-denied     # status, module, meaning, hint and runbook
relata explain-error access            # unknown: suggests close codes

The command reads the catalogue built into the binary and opens no socket.

Count errors by code

relata_problem_responses_total{code,module} counts problem responses by code and owning module. It is bounded to 512 distinct codes, then reports other. The module follows from the code, so it adds no series. Sum by code when you do not need the module:

topk(10, sum by (code) (rate(relata_problem_responses_total[5m])))
sum by (module) (rate(relata_problem_responses_total[5m]))

Pair it with relata_http_requests_total{status_class="5xx"} by endpoint to see which route returns a code. relata_module_errors_total{module,op,code} shows which operation inside a module failed.

The errors view

relata_stat_errors has one row per code and module, like ClickHouse's system.errors:

SELECT code, module, count, last_request_id FROM relata_stat_errors ORDER BY count DESC LIMIT 10
SELECT * FROM relata_stat_errors WHERE module = 'planner'
ColumnMeaning
codeThe catalogue code; none for a problem with no code, other past 512 codes.
moduleThe owning module; http for a code outside the catalogue.
countResponses with this code since the process started.
last_time_nsTime of the last one, nanoseconds UTC.
last_request_idRequest id of the last one. Search the logs and the audit log with it.

Also the errors key of GET /v1/system/stats. Operator and oversight keys only; a tenant-scoped token gets 403 forbidden. Counters live for the process.

From an error to its cause

  1. Take the request_id from the body, or last_request_id from relata_stat_errors.
  2. Look it up in the audit log: GET /v1/audit/log?request_id=<id> (see Audit and login activity).
  3. Read the log lines for that request from /admin/logs (see Logging). Failures and writes are always access-logged with the id.
  4. Follow the runbook the catalogue names for the code. A code with no runbook is a client mistake; fix the request. For 503 codes tied to node state (rollover-pending, storage-recovering, memory-pressure, server-overloaded), also check /health/ready.

What is coming

Further error-reporting items are tracked in #7849.