module Cql::ErrorCodes

Constants

ALREADY_EXISTS

The query attempted to create a keyspace or a table that was already existing.

Details:

  • ‘:ks` - A string representing either the keyspace that already exists, or the keyspace in which the table that already exists is.

  • ‘:table` - A string representing the name of the table that already exists. If the query was attempting to create a keyspace, `:table` will be present but will be the empty string.

BAD_CREDENTIALS

CREDENTIALS request failed because Cassandra did not accept the provided credentials.

CONFIG_ERROR

The query is invalid because of some configuration issue.

INVALID

The query is syntactically correct but invalid.

IS_BOOTSTRAPPING

The request was a read request but the coordinator node is bootstrapping.

OVERLOADED

The request cannot be processed because the coordinator node is overloaded.

PROTOCOL_ERROR

Some client message triggered a protocol violation (for instance a QUERY message is sent before a STARTUP one has been sent).

READ_TIMEOUT

Timeout exception during a read request.

Details:

  • ‘:cl` - The consistency level of the query having triggered the exception

  • ‘:received` - An int representing the number of nodes having answered the request.

  • ‘:blockfor` - The number of replica whose response is required to achieve `:cl`. Please note that it is possible to have `:received` >= `:blockfor` if `:data_present` is false. And also in the (unlikely) case were `:cl` is achieved but the coordinator node timeout while waiting for read-repair acknowledgement.

  • ‘:data_present` - If `true`, it means the replica that was asked for data has not responded.

SERVER_ERROR

Something unexpected happened. This indicates a server-side bug.

SYNTAX_ERROR

The submitted query has a syntax error.

TRUNCATE_ERROR

Error during a truncation error.

UNAUTHORIZED

The logged user doesn’t have the right to perform the query.

UNAVAILABLE

Unavailable exception.

Details:

  • ‘:cl` - The consistency level of the query having triggered the exception.

  • ‘:required` - An int representing the number of nodes that should be alive to respect `:cl`.

  • ‘:alive` - An int representing the number of replica that were known to be alive when the request has been processed (since an unavailable exception has been triggered, there will be `:alive` < `:required`.

UNPREPARED

Can be thrown while a prepared statement tries to be executed if the provide prepared statement ID is not known by this host.

Details:

  • ‘:id` - The unknown ID.

WRITE_TIMEOUT

Timeout exception during a write request.

Details:

  • ‘:cl` - The consistency level of the query having triggered the exception.

  • ‘:received` - An int representing the number of nodes having acknowledged the request.

  • ‘:blockfor` - The number of replica whose acknowledgement is required to achieve `:cl`.

  • ‘:write_type` - A string that describe the type of the write that timeouted. The value of that string can be one of:

    • ‘“SIMPLE”`: the write was a non-batched non-counter write.

    • ‘“BATCH”`: the write was a (logged) batch write. If this type is received, it means the batch log has been successfully written (otherwise a `“BATCH_LOG”` type would have been send instead).

    • ‘“UNLOGGED_BATCH”`: the write was an unlogged batch. Not batch log write has been attempted.

    • ‘“COUNTER”`: the write was a counter write (batched or not).

    • ‘“BATCH_LOG”`: the timeout occured during the write to the batch log when a (logged) batch write was requested.