gRPC status codes

YDB provides the gRPC API, which you can use to manage your database resources and data. The following table describes the gRPC status codes:

Code

Status

Retryability

Backoff strategy

Recreate session

0

OK

1

CANCELLED

conditionally-retryable

fast

yes

2

UNKNOWN

non-retryable

yes

3

INVALID_ARGUMENT

non-retryable

yes

4

DEADLINE_EXCEEDED

conditionally-retryable

fast

yes

5

NOT_FOUND

non-retryable

yes

6

ALREADY_EXISTS

non-retryable

yes

7

PERMISSION_DENIED

non-retryable

yes

8

RESOURCE_EXHAUSTED

retryable

slow

no

9

FAILED_PRECONDITION

non-retryable

yes

10

ABORTED

retryable

instant

yes

11

OUT_OF_RANGE

non-retryable

no

12

UNIMPLEMENTED

non-retryable

yes

13

INTERNAL

conditionally-retryable

fast

yes

14

UNAVAILABLE

conditionally-retryable

fast

yes

15

DATA_LOSS

non-retryable

yes

16

UNAUTHENTICATED

non-retryable

yes

0: OK

Not an error; returned on success.

1: CANCELLED

Conditionally retryable | Fast Backoff

The operation was cancelled, typically by the caller.

2: UNKNOWN

Non-retryable

Unknown error. For example, this error may be returned when a Status value received from another address space belongs to an error space that is not known in this address space. Errors raised by APIs that do not return enough error information may also be converted to this error.

3: INVALID_ARGUMENT

Non-retryable

The client specified an invalid argument. Unlike FAILED_PRECONDITION, INVALID_ARGUMENT indicates arguments that are problematic regardless of the system state (e.g., a malformed file name).

4: DEADLINE_EXCEEDED

Conditionally retryable | Fast Backoff

The query was not processed within the specified client timeout, or a network issue occurred.

Check the specified timeout, network access, endpoint, and other network settings. Reduce the query rate and optimize queries.

5: NOT_FOUND

Non-retryable

A requested scheme object (for example, a table or directory) was not found.

6: ALREADY_EXISTS

Non-retryable

The scheme object that a client attempted to create (e.g., file or directory) already exists.

7: PERMISSION_DENIED

Non-retryable

The caller does not have permission to execute the specified operation.

8: RESOURCE_EXHAUSTED

Retryable | Slow Backoff

There are not enough resources available to fulfill the query.

Reduce the query rate and check client balancing.

9: FAILED_PRECONDITION

Non-retryable

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

Fix the state or query, then retry.

10: ABORTED

Retryable | Instant

The operation was aborted, typically due to a concurrency issue, such as a transaction abort.

11: OUT_OF_RANGE

Non-retryable

The operation was attempted past the valid range. Unlike INVALID_ARGUMENT, this error indicates a problem that may be fixed if the system state changes.

12: UNIMPLEMENTED

Non-retryable

The operation is not implemented, supported, or enabled in this service.

13: INTERNAL

Conditionally retryable | Fast Backoff

Internal errors. This means that some invariants expected by the underlying system have been broken. This error code is reserved for significant problems.

14: UNAVAILABLE

Conditionally retryable | Fast Backoff

The service is currently unavailable. This is most likely a transient condition that can be corrected by retrying with a backoff. Note that it is not always safe to retry non-idempotent operations.

15: DATA_LOSS

Non-retryable

Unrecoverable data loss or corruption.

16: UNAUTHENTICATED

Non-retryable

The request did not have valid authentication credentials.

Retry the request with valid authentication credentials.