DB_ERROR — Database query failure
Summary
Section titled “Summary”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.
HTTP status
Section titled “HTTP status”500 Internal Server Error. Standard envelope.
Example response
Section titled “Example response”{ "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" }}Why this happens
Section titled “Why this happens”- 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.
How to fix it
Section titled “How to fix it”- Retry with backoff — 2s, 4s, 8s. Most retries succeed on the second attempt.
- Use an idempotency key on writes so the retry is safe.
- If you see
DB_ERRORfrom the same endpoint for more than a minute, check the status page. - Persistent
DB_ERROR→ email support@surveycoder.io with therequest_id.