---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://ydb.tech/docs/en/reference/ydb-sdk/ydb-status-codes.md
  - https://ydb.tech/docs/ru/reference/ydb-sdk/ydb-status-codes.md
  - href: en/reference/ydb-sdk/ydb-status-codes.md
    type: text/markdown
    title: Markdown version
  - href: ../../llms.txt
    type: text/markdown
    title: llms.txt
sourcePath: en/core/reference/ydb-sdk/ydb-status-codes.md
---
> **Documentation Index:** Fetch the complete configuration index at https://ydb.tech/docs/en/llms.txt

# Status codes from the YDB server

[//]: # (Information from https://GitHub.com/ydb-platform/ydb-go-sdk/blob/master/retry/errors_data_test.go)

#|
||
Code
|
Status
|
Retryability
|
Backoff strategy
|
Recreate session
||

||
[400000](#success)
|
[SUCCESS](#success)
|
–
|
–
|
–
||

||
[400010](#bad-request)
|
[BAD_REQUEST](#bad-request)
|
[non-retryable](*nonretryable)
|
–
|
no
||

||
[400020](#unauthorized)
|
[UNAUTHORIZED](#unauthorized)
|
[non-retryable](*nonretryable)
|
–
|
no
||

||
[400030](#internal-error)
|
[INTERNAL_ERROR](#internal-error)
|
[non-retryable](*nonretryable)
|
–
|
no
||

||
[400040](#aborted)
|
[ABORTED](#aborted)
|
[retryable](*retryable)
|
[fast](*fastbackoff)
|
no
||

||
[400050](#unavailable)
|
[UNAVAILABLE](#unavailable)
|
[retryable](*retryable)
|
[fast](*fastbackoff)
|
no
||

||
[400060](#overloaded)
|
[OVERLOADED](#overloaded)
|
[retryable](*retryable)
|
[slow](*slowbackoff)
|
no
||

||
[400070](#scheme-error)
|
[SCHEME_ERROR](#scheme-error)
|
[non-retryable](*nonretryable)
|
–
|
no
||

||
[400080](#generic-error)
|
[GENERIC_ERROR](#generic-error)
|
[non-retryable](*nonretryable)
|
–
|
no
||

||
[400090](#timeout)
|
[TIMEOUT](#timeout)
|
[non-retryable](*nonretryable)
|
–
|
no
||

||
[400100](#bad-session)
|
[BAD_SESSION](#bad-session)
|
[retryable](*retryable)
|
[instant](*instant)
|
yes
||

||
[400120](#precondition-failed)
|
[PRECONDITION_FAILED](#precondition-failed)
|
[non-retryable](*nonretryable)
|
–
|
no
||

||
[400130](#already-exists)
|
[ALREADY_EXISTS](#already-exists)
|
[non-retryable](*nonretryable)
|
–
|
no
||

||
[400140](#not-found)
|
[NOT_FOUND](#not-found)
|
[non-retryable](*nonretryable)
|
–
|
no
||

||
[400150](#session-expired)
|
[SESSION_EXPIRED](#session-expired)
|
[retryable](*retryable)
|
[instant](*instant)
|
yes
||

||
[400160](#cancelled)
|
[CANCELLED](#cancelled)
|
[non-retryable](*nonretryable)
|
–
|
no
||

||
[400170](#undetermined)
|
[UNDETERMINED](#undetermined)
|
[conditionally-retryable](*condretryable)
|
[fast](*fastbackoff)
|
no
||

||
[400180](#unsupported)
|
[UNSUPPORTED](#unsupported)
|
[non-retryable](*nonretryable)
|
–
|
no
||

||
[400190](#session-busy)
|
[SESSION_BUSY](#session-busy)
|
[retryable](*retryable)
|
[fast](*fastbackoff)
|
yes
||

||
[400200](#external-error)
|
[EXTERNAL_ERROR](#external-error)
|
[non-retryable](*nonretryable)
|
–
|
no
||
|#

## 400000: SUCCESS {#success}

The query was processed successfully.

No response is required. Continue application execution.

<div class="tags_list">

## 400010: BAD_REQUEST {#bad-request}

<!-- source: en/reference/ydb-sdk/_includes/tags.md -->
 <span class = "overview-tag tags-shape tags-color-text"> [Non-retryable](https://ydb.tech/docs/en/reference/ydb-sdk/error_handling.md) </span>
<!-- endsource: en/reference/ydb-sdk/_includes/tags.md -->

</div>

Invalid query syntax or missing required fields.

Correct the query.

<div class="tags_list">

## 400020: UNAUTHORIZED {#unauthorized}

<!-- source: en/reference/ydb-sdk/_includes/tags.md -->
 <span class = "overview-tag tags-shape tags-color-text"> [Non-retryable](https://ydb.tech/docs/en/reference/ydb-sdk/error_handling.md) </span>
<!-- endsource: en/reference/ydb-sdk/_includes/tags.md -->

</div>

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

Request access from its owner.

<div class="tags_list">

## 400030: INTERNAL_ERROR {#internal-error}

<!-- source: en/reference/ydb-sdk/_includes/tags.md -->
 <span class = "overview-tag tags-shape tags-color-text"> [Non-retryable](https://ydb.tech/docs/en/reference/ydb-sdk/error_handling.md) </span>
<!-- endsource: en/reference/ydb-sdk/_includes/tags.md -->

</div>

An unknown internal error occurred.

File a [GitHub issue](https://github.com/ydb-platform/ydb/issues/new) or contact YDB technical support.

<div class="tags_list">

## 400040: ABORTED {#aborted}

<!-- source: en/reference/ydb-sdk/_includes/tags.md -->
 <span class = "practice-tag tags-shape tags-color-text"> [Retryable](https://ydb.tech/docs/en/reference/ydb-sdk/error_handling.md) | Fast Backoff </span>
<!-- endsource: en/reference/ydb-sdk/_includes/tags.md -->

</div>

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

Retry the entire transaction.

<div class="tags_list">

## 400050: UNAVAILABLE {#unavailable}

<!-- source: en/reference/ydb-sdk/_includes/tags.md -->
 <span class = "practice-tag tags-shape tags-color-text"> [Retryable](https://ydb.tech/docs/en/reference/ydb-sdk/error_handling.md) | Fast Backoff </span>
<!-- endsource: en/reference/ydb-sdk/_includes/tags.md -->

</div>

A part of the system is not available.

Retry the last action (query).

<div class="tags_list">

## 400060: OVERLOADED {#overloaded}

<!-- source: en/reference/ydb-sdk/_includes/tags.md -->
 <span class = "practice-tag tags-shape tags-color-text"> [Retryable](https://ydb.tech/docs/en/reference/ydb-sdk/error_handling.md) | Slow Backoff </span>
<!-- endsource: en/reference/ydb-sdk/_includes/tags.md -->

</div>

A part of the system is overloaded.

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

<div class="tags_list">

## 400070: SCHEME_ERROR {#scheme-error}

<!-- source: en/reference/ydb-sdk/_includes/tags.md -->
 <span class = "overview-tag tags-shape tags-color-text"> [Non-retryable](https://ydb.tech/docs/en/reference/ydb-sdk/error_handling.md) </span>
<!-- endsource: en/reference/ydb-sdk/_includes/tags.md -->

</div>

The query does not match the schema.

Correct the query or schema.

<div class="tags_list">

## 400080: GENERIC_ERROR {#generic-error}

<!-- source: en/reference/ydb-sdk/_includes/tags.md -->
 <span class = "overview-tag tags-shape tags-color-text"> [Non-retryable](https://ydb.tech/docs/en/reference/ydb-sdk/error_handling.md) </span>
<!-- endsource: en/reference/ydb-sdk/_includes/tags.md -->

</div>

An unclassified error occurred, possibly related to the query.

See the detailed error message. If necessary, file a [GitHub issue](https://github.com/ydb-platform/ydb/issues/new) or contact YDB technical support.

<div class="tags_list">

## 400090: TIMEOUT {#timeout}

<!-- source: en/reference/ydb-sdk/_includes/tags.md -->
 <span class = "use_cases-tag tags-shape tags-color-text"> [Conditionally retryable](https://ydb.tech/docs/en/reference/ydb-sdk/error_handling.md) | Instant </span>
<!-- endsource: en/reference/ydb-sdk/_includes/tags.md -->

</div>

The query timeout expired.

If the query is idempotent, retry it.

<div class="tags_list">

## 400100: BAD_SESSION {#bad-session}

<!-- source: en/reference/ydb-sdk/_includes/tags.md -->
 <span class = "practice-tag tags-shape tags-color-text"> [Retryable](https://ydb.tech/docs/en/reference/ydb-sdk/error_handling.md) | Instant </span>
<!-- endsource: en/reference/ydb-sdk/_includes/tags.md -->

</div>

This session is no longer available.

Create a new session.

<div class="tags_list">

## 400120: PRECONDITION_FAILED {#precondition-failed}

<!-- source: en/reference/ydb-sdk/_includes/tags.md -->
 <span class = "overview-tag tags-shape tags-color-text"> [Non-retryable](https://ydb.tech/docs/en/reference/ydb-sdk/error_handling.md) </span>
<!-- endsource: en/reference/ydb-sdk/_includes/tags.md -->

</div>

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.

<div class="tags_list">

## 400130: ALREADY_EXISTS {#already-exists}

<!-- source: en/reference/ydb-sdk/_includes/tags.md -->
 <span class = "overview-tag tags-shape tags-color-text"> [Non-retryable](https://ydb.tech/docs/en/reference/ydb-sdk/error_handling.md) </span>
<!-- endsource: en/reference/ydb-sdk/_includes/tags.md -->

</div>

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

The response depends on the application logic.

<div class="tags_list">

## 400140: NOT_FOUND {#not-found}

<!-- source: en/reference/ydb-sdk/_includes/tags.md -->
 <span class = "overview-tag tags-shape tags-color-text"> [Non-retryable](https://ydb.tech/docs/en/reference/ydb-sdk/error_handling.md) </span>
<!-- endsource: en/reference/ydb-sdk/_includes/tags.md -->

</div>

The database object was not found in the YDB database.

The response depends on the application logic.

<div class="tags_list">

## 400150: SESSION_EXPIRED {#session-expired}

<!-- source: en/reference/ydb-sdk/_includes/tags.md -->
 <span class = "use_cases-tag tags-shape tags-color-text"> [Conditionally retryable](https://ydb.tech/docs/en/reference/ydb-sdk/error_handling.md) | Instant </span>
<!-- endsource: en/reference/ydb-sdk/_includes/tags.md -->

</div>

The session has already expired.

Create a new session.

<div class="tags_list">

## 400160: CANCELLED {#cancelled}

<!-- source: en/reference/ydb-sdk/_includes/tags.md -->
 <span class = "overview-tag tags-shape tags-color-text"> [Non-retryable](https://ydb.tech/docs/en/reference/ydb-sdk/error_handling.md) </span>
<!-- endsource: en/reference/ydb-sdk/_includes/tags.md -->

</div>

The request was canceled on the server. For example, a user canceled a long-running query in the [Embedded UI](https://ydb.tech/docs/en/reference/embedded-ui/index.md), or the query included the [cancel_after](https://ydb.tech/docs/en/dev/timeouts.md#cancel) 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.

<div class="tags_list">

## 400170: UNDETERMINED {#undetermined}

<!-- source: en/reference/ydb-sdk/_includes/tags.md -->
 <span class = "use_cases-tag tags-shape tags-color-text"> [Conditionally retryable](https://ydb.tech/docs/en/reference/ydb-sdk/error_handling.md) | Fast Backoff </span>
<!-- endsource: en/reference/ydb-sdk/_includes/tags.md -->

</div>

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.

<div class="tags_list">

## 400180: UNSUPPORTED {#unsupported}

<!-- source: en/reference/ydb-sdk/_includes/tags.md -->
 <span class = "overview-tag tags-shape tags-color-text"> [Non-retryable](https://ydb.tech/docs/en/reference/ydb-sdk/error_handling.md) </span>
<!-- endsource: en/reference/ydb-sdk/_includes/tags.md -->

</div>

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.

<div class="tags_list">

## 400190: SESSION_BUSY {#session-busy}

<!-- source: en/reference/ydb-sdk/_includes/tags.md -->
 <span class = "practice-tag tags-shape tags-color-text"> [Retryable](https://ydb.tech/docs/en/reference/ydb-sdk/error_handling.md) | Fast Backoff </span>
<!-- endsource: en/reference/ydb-sdk/_includes/tags.md -->

</div>

The session is busy.

Create a new session.

<div class="tags_list">

## 400200: EXTERNAL_ERROR {#external-error}

<!-- source: en/reference/ydb-sdk/_includes/tags.md -->
 <span class = "overview-tag tags-shape tags-color-text"> [Non-retryable](https://ydb.tech/docs/en/reference/ydb-sdk/error_handling.md) </span>
<!-- endsource: en/reference/ydb-sdk/_includes/tags.md -->

</div>

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](https://github.com/ydb-platform/ydb/issues/new) or contact YDB technical support.


## See also

[Questions and answers: Errors](https://ydb.tech/docs/en/faq/errors.md)

[*instant]: **Instant retry** is one of the backoff strategies used in YDB SDK when retrying queries that return an error.<br/>
This strategy retries queries immediately after receiving an error.<br/>
For more information, see [Handling retryable errors](https://ydb.tech/docs/en/reference/ydb-sdk/error_handling.md#handling-retryable-errors).

[*fastbackoff]: **Fast exponential backoff** is one of the backoff strategies used in YDB SDK when retrying queries that return an error.<br/>
The initial interval for this strategy is several **milliseconds**. For each subsequent attempt, the interval increases exponentially.<br/>
For more information, see [Handling retryable errors](https://ydb.tech/docs/en/reference/ydb-sdk/error_handling.md#handling-retryable-errors).

[*slowbackoff]: **Slow exponential backoff** is one of the backoff strategies used by YDB SDK when retrying queries that return an error.<br/>
The initial interval for this strategy is several **seconds**. For each subsequent attempt, the interval increases exponentially.<br/>
For more information, see [Handling retryable errors](https://ydb.tech/docs/en/reference/ydb-sdk/error_handling.md#handling-retryable-errors).

[*retryable]: **Temporary failures** (retryable). Such errors include a short-term loss of network connectivity, temporary unavailability, overload of a YDB subsystem, or a failure of YDB to respond to a query within the set timeout. If one of these errors occurs, retrying the failed query is likely to be successful after some time.

[*nonretryable]: **Errors that cannot be fixed with a retry** (non-retryable). Such errors are caused by incorrectly written queries, YDB internal errors, or queries that mismatch the data schema. Retrying such queries will not resolve the issue. This situation requires developer attention.

[*condretryable]: **Errors that can presumably be fixed with a retry after the client application response** (conditionally retryable). Such errors include no response within the set timeout or an authentication request. Only idempotent operations can be fixed with a retry.