Skip to main content
Every HydraDB error arrives in the same envelope. Branch on error.code, log meta.request_id, and retry only the failures listed under Retry pattern.

Response envelope

HydraDB core endpoints (/databases, /context/*, /query, /feedback, and /webhooks/indexing*) use the same top-level envelope for successful and failed requests. Connector endpoints (/connectors*) and PATCH /databases/{database}/metadata-schema return their success body without this envelope, but their errors use it too.
The HTTP status tells you the class of failure; the error code tells you what to do.

HTTP status codes

Common error codes

Endpoint pages list the most common codes for that operation. New codes may be added over time, so handle unknown error.code values gracefully. PATCH /databases/{database}/metadata-schema currently returns INTERNAL_ERROR for its 400 and 409 errors too, so branch on the HTTP status there. For deprecated route and field behavior, see Migrating from tenant fields.

Ingestion error codes

Asynchronous ingestion failures surface a numeric E#### code in the error_code field of GET /context/status responses and indexing.status_changed webhook payloads. The HTTP error.code values above describe why a request was rejected. These codes describe why a specific source failed to index. Many storage- and capacity-related ingestion errors are transient: the pipeline retries them automatically with backoff, and they typically resolve within minutes. A code in error_code does not by itself mean the source has failed permanently. Treat a source as failed only once it reaches the terminal errored status. Files rejected with E1002 have no ingestion status record. Handle this code from the upload response. See Supported file formats.

Retry pattern

Retry only transient failures: 429, 500, and 503. Use exponential backoff with jitter and keep retries bounded. Two other codes clear on their own, so wait instead of backing off blindly: 409 SOURCE_PROCESSING (wait for Retry-After) and 422 TENANT_INFRA_NOT_READY (wait until the database is ready). The SDKs already retry: both retry 408, 429, and 5xx responses twice with exponential backoff before raising, and the Python SDK also retries 409. Raise the count with request_options={"max_retries": 5} on a Python call, or maxRetries on the TypeScript client or call. The SDK examples below increase that limit. The raw HTTP example implements retries directly. Retry writes only when repeating the operation is safe.

Handle errors in code

Both SDKs raise an exception for a non-2xx response. Read the code and request ID from the exception’s response body. See SDKs for the exception classes.

Troubleshooting

401 UNAUTHORIZED on every request

Send exactly one Authorization header:
Also send API-Version: 2 on raw HTTP requests. The SDKs set the version header automatically.

422 TENANT_INFRA_NOT_READY right after creating a database

Database creation is asynchronous, and a query sent before provisioning finishes returns this error. After POST /databases, poll GET /databases/status until infra.ready_for_ingestion is true, then retry.

Validation errors on ingest

Common causes:
  • document_metadata length does not match the documents array length.
  • app_knowledge, memories, or document_metadata was sent as an object instead of a JSON-stringified multipart field.
  • A memory item has neither text nor user_assistant_pairs.
  • A typed metadata value does not match the database metadata schema.

Empty query results

An empty result is a successful response, not an error. Common causes:
  • The source is still queued or processing. Poll GET /context/status.
  • metadata_filters is too restrictive or targets the wrong metadata namespace.
  • The query is scoped to the wrong database or collection.
  • The type value excludes the store you need. Use type: "all" to combine knowledge and memories in POST /query.