Skip to content

DB_ERROR — Database query failure

A database query the request depended on failed. Usually transient — connection blip, replica lag, occasional timeout. Retrying once with an idempotency key is almost always the right move.

500 Internal Server Error. Standard envelope.

{
"success": false,
"error": {
"code": "DB_ERROR",
"message": "Database query failed. Please retry.",
"request_id": "req_01HXJZK4ABCDEF",
"doc_url": "https://docs.surveycoder.io/errors/db-error"
}
}
  • Connection pool exhaustion under a burst.
  • A read replica lagging behind primary.
  • A transient query timeout.
  • (Rare) a real schema-level issue we haven’t deployed a fix for yet.
  1. Retry with backoff — 2s, 4s, 8s. Most retries succeed on the second attempt.
  2. Use an idempotency key on writes so the retry is safe.
  3. If you see DB_ERROR from the same endpoint for more than a minute, check the status page.
  4. Persistent DB_ERROR → email support@surveycoder.io with the request_id.