Status codes from the YDB server

Code

Status

Retryability

Backoff strategy

Recreate session

400000

SUCCESS

400010

BAD_REQUEST

non-retryable

no

400020

UNAUTHORIZED

non-retryable

no

400030

INTERNAL_ERROR

non-retryable

no

400040

ABORTED

retryable

fast

no

400050

UNAVAILABLE

retryable

fast

no

400060

OVERLOADED

retryable

slow

no

400070

SCHEME_ERROR

non-retryable

no

400080

GENERIC_ERROR

non-retryable

no

400090

TIMEOUT

non-retryable

no

400100

BAD_SESSION

retryable

instant

yes

400120

PRECONDITION_FAILED

non-retryable

no

400130

ALREADY_EXISTS

non-retryable

no

400140

NOT_FOUND

non-retryable

no

400150

SESSION_EXPIRED

retryable

instant

yes

400160

CANCELLED

non-retryable

no

400170

UNDETERMINED

conditionally-retryable

fast

no

400180

UNSUPPORTED

non-retryable

no

400190

SESSION_BUSY

retryable

fast

yes

400200

EXTERNAL_ERROR

non-retryable

no

400000: SUCCESS

The query was processed successfully.

No response is required. Continue application execution.

400010: BAD_REQUEST

Non-retryable

Invalid query syntax or missing required fields.

Correct the query.

400020: UNAUTHORIZED

Non-retryable

Access to the requested schema object (for example, a table or directory) is denied.

Request access from its owner.

400030: INTERNAL_ERROR

Non-retryable

An unknown internal error occurred.

File a GitHub issue or contact YDB technical support.

400040: ABORTED

Retryable | Fast Backoff

The operation was aborted. Possible reasons might include lock invalidation with TRANSACTION_LOCKS_INVALIDATED in detailed error messages.

Retry the entire transaction.

400050: UNAVAILABLE

Retryable | Fast Backoff

A part of the system is not available.

Retry the last action (query).

400060: OVERLOADED

Retryable | Slow Backoff

A part of the system is overloaded.

Retry the last action (query) and reduce the query rate.

400070: SCHEME_ERROR

Non-retryable

The query does not match the schema.

Correct the query or schema.

400080: GENERIC_ERROR

Non-retryable

An unclassified error occurred, possibly related to the query.

See the detailed error message. If necessary, file a GitHub issue or contact YDB technical support.

400090: TIMEOUT

Conditionally retryable | Instant

The query timeout expired.

If the query is idempotent, retry it.

400100: BAD_SESSION

Retryable | Instant

This session is no longer available.

Create a new session.

400120: PRECONDITION_FAILED

Non-retryable

The query cannot be executed in the current state. For example, inserting data into a table with an existing key.

Correct the state or query, then retry.

400130: ALREADY_EXISTS

Non-retryable

The database object being created already exists in the YDB cluster.

The response depends on the application logic.

400140: NOT_FOUND

Non-retryable

The database object was not found in the YDB database.

The response depends on the application logic.

400150: SESSION_EXPIRED

Conditionally retryable | Instant

The session has already expired.

Create a new session.

400160: CANCELLED

Non-retryable

The request was canceled on the server. For example, a user canceled a long-running query in the Embedded UI, or the query included the cancel_after timeout option.

If the query took too long to complete, try optimizing it. If you used the cancel_after timeout option, increase the timeout value.

400170: UNDETERMINED

Conditionally retryable | Fast Backoff

An unknown transaction status. The query ended with a failure, making it impossible to determine the transaction status. Queries that terminate with this status are subject to transaction integrity and atomicity guarantees. That is, either all changes are registered, or the entire transaction is canceled.

For idempotent transactions, retry the entire transaction after a short delay. Otherwise, the response depends on the application logic.

400180: UNSUPPORTED

Non-retryable

The query is not supported by YDB either because support for such queries is not yet implemented or is not enabled in the YDB configuration.

Correct the query or enable support for such queries in YDB.

400190: SESSION_BUSY

Retryable | Fast Backoff

The session is busy.

Create a new session.

400200: EXTERNAL_ERROR

Non-retryable

An error occurred in an external system, for example, when processing a federated query or importing data from an external data source.

See the detailed error message. If necessary, file a GitHub issue or contact YDB technical support.

See also

Questions and answers: Errors