Error Messages
- reference
The standardized error codes returned by the Couchbase Python SDK, from cloud connection to sub-document.
All exceptions derive from a common base Couchbase exception. Exceptions (errors) are broken into different classifications:
-
Shared Exceptions — exceptions or errors thrown or returned by any service.
-
Specific Exceptions — exceptions or errors thrown by a service and specific to the service that threw or returned them.
-
Internal Exceptions — exceptions intended to be handled internally by the SDK and not exposed to the application.
The base exception, CouchbaseException
, has two properties — an ErrorContext
and an optional Cause.
The ErrorContext
provides extensive debugging information in JSON format.
Below are the exceptions, categorised by service.
Shared Error Definitions
ID Range: 1-99
# 1 Timeout
Raised when a request cannot be completed until the user-defined timeout fires.
Note, this is a base class for #13 and #14 (Ambiguous and Unambiguous).
# 2 RequestCanceled
Raised when a request is cancelled and cannot be resolved in a non-ambiguous way. Most likely the request is in-flight on the socket and the socket gets closed.
# 3 InvalidArgument
Raised when it is unambiguously determined that the error was caused because of invalid arguments from the user. Usually only thrown directly when doing request arg validation on KV and sub-doc. Also commonly used as a parent class for many service-specific exceptions (see below).
# 4 ServiceNotAvailable
Raised when it can be determined from the config unambiguously that a given service is not available. I.e. no query node in the config, or a memcached bucket is accessed and views or queries should be performed.
# 5 InternalServerFailure
Raised when:
-
Query: Error range 5xxx.
-
Analytics: Error range 25xxx.
-
KV: error code ERR_INTERNAL (0x84).
-
Search: HTTP 500.
# 6 AuthenticationFailure
Raised when:
-
Query: Error range 10xxx.
-
Analytics: Error range 20xxx.
-
View: HTTP status 401.
-
KV: error code
ERR_ACCESS (0x24)
,ERR_AUTH_ERROR (0x20)
,AUTH_STALE (0x1f)
. -
Search: HTTP status 401, 403.
# 7 TemporaryFailure
Raised when:
-
Analytics: Errors: 23000, 23003.
-
KV: Error code
ERR_TMPFAIL (0x86)
,ERR_BUSY (0x85)
ERR_OUT_OF_MEMORY (0x82)
,ERR_NOT_INITIALIZED (0x25)
.
# 9 CasMismatch
Raised when:
-
KV:
ERR_EXISTS (0x02)
when replace or remove with CAS. -
Query: code 12009.
# 11 CollectionNotFound
Raised when a request is made but the current collection (including scope) is not found.
# 13 AmbiguousTimeout
Raised when a timeout occurs and we aren’t sure if the underlying operation has completed. This normally occurs because we sent the request to the server successfully, but timed out waiting for the response. Note that idempotent operations should never return this, as they do not have ambiguity.
# 14 UnambiguousTimeout
Raised when a timeout occurs and we are confident that the operation could not have succeeded. This normally would occur because we received confident failures from the server, or never managed to successfully dispatch the operation.
# 17 IndexNotFound
Raised when:
-
Query:
-
Codes 12004, 12016.
-
Codes 5000 AND message contains index .+ not found.
-
-
Analytics: rised when 24047 raised.
-
Search: Http status code 400 AND text contains "index not found".
KeyValue Error Definitions
ID Range 100 - 199
# 101 DocumentNotFound
Raised when the document requested was not found on the server — KV Code 0x01
.
# 102 DocumentUnretrievable
Raised when in getAnyReplica
, the getAllReplicas
returns an empty stream because all the individual errors are dropped (i.e. all returned a DocumentNotFound
).
# 104 ValueTooLarge
Raised when the value that was sent was too large to store (typically > 20MB); KV Code 0x03
.
# 105 DocumentExists
Raised when an operation which relies on the document not existing fails because the document existed; KV Code 0x02
.
# 107 DurabilityLevelNotAvailable
Raised when the specified durability level is invalid; KV Code 0xa0
.
# 108 DurabilityImpossible
Raised when the specified durability requirements are not currently possible (for example, there are an insufficient number of replicas online); KV Code 0xa1
.
# 109 DurabilityAmbiguous
Raised when A sync-write has not completed in the specified time and has an ambiguous result - it may have succeeded or failed, but the final result is not yet known. A SEQNO OBSERVE operation is performed and the vbucket UUID changes during polling. KV Code 0xa3
# 110 DurableWriteInProgress
Raised when A durable write is attempted against a key which already has a pending durable write. KV Code 0xa2
# 111 DurableWriteReCommitInProgress
Raised when The server is currently working to synchronize all replicas for previously performed durable operations (typically occurs after a rebalance). KV Code 0xa4
# 113 PathNotFound
Raised when the path provided for a sub-document operation was not found; KV Code 0xc0
.
# 114 PathMismatch
The path provided for a sub-document operation did not match the actual structure of the document; KV Code 0xc1
.
# 115 PathInvalid
Raised when the path provided for a sub-document operation was not syntactically correct; KV Code 0xc2
.
# 116 PathTooBig
Raised when the path provided for a sub-document operation is too long, or contains too many independent components; KV Code 0xc3
.
# 118 ValueTooDeep
Raised when the value provided, if inserted into the document, would cause the document to become too deep for the server to accept; KV Code 0xca
.
# 119 ValueInvalid
Raised when the value provided for a sub-document operation would invalidate the JSON structure of the document if inserted as requested; KV Code 0xc5
.
# 120 DocumentNotJson
Raised when a Sub-Document operation is performed on a non-JSON document; KV Code 0xc6
.
# 121 NumberTooBig
Raised when the existing number is outside the valid range for arithmetic operations; KV Code 0xc7
.
# 122 DeltaInvalid
Raised when the delta value specified for an operation is too large; KV Code 0xc8
.
# 123 PathExists
Raised when a sub-document operation which relies on a path not existing encountered a path which exists; KV Code 0xc9
.
# 124 XattrUnknownMacro
Raised when a macro was used which the server did not understand; KV Code: 0xd0
.
# 126 XattrInvalidKeyCombo
Raised when a Sub-Document operation attempts to access multiple xattrs in one operation; KV Code: 0xcf
.
# 127 XattrUnknownVirtualAttribute
Raised when a sub-document operation attempts to access a virtual attribute; KV Code: 0xd1
.
Query Error Definitions
ID Range 200 - 299
# 201 PlanningFailure
Query: Raised when code range 4xxx other than those explicitly covered.
# 203 PreparedStatementFailure
Query: Raised when codes 4040, 4050, 4060, 4070, 4080, 4090.
Analytics Error Definitions
ID Range 300 - 399
# 301 CompilationFailure
Raised when error range 24xxx (excluded are specific codes in the errors below).
# 302 JobQueueFull
Raised when error code 23007.
# 303 DatasetNotFound
Raised when error codes 24044, 24045, 24025.
# 304 DataverseNotFound
Raised when error code 24034.
# 305 DatasetExists
Raised when 24040.
# 306 DataverseExists
Raised when 24039.
# 307 LinkNotFound
Raised when 24006.
Search Error Definition
ID Range 400 - 499
There are no specific errors for Search; see the Shared Error Definitions section for errors that apply to Search.
Field-Level Encryption Error Definitions
ID Range 700 - 799
# 700 CryptoException
Generic cryptography failure. Inherits from CouchbaseException (=== # 0). Parent Type for all other Field-Level Encryption errors.
# 701 EncryptionFailure
Raised by CryptoManager.encrypt()
when encryption fails for any reason.
Should have one of the other Field-Level Encryption errors as a cause.
# 702 DecryptionFailure
Raised by CryptoManager.decrypt()
when decryption fails for any reason.
Should have one of the other Field-Level Encryption errors as a cause.
# 704 InvalidCryptoKey
Raised by an encrypter or decrypter when the key does not meet expectations (for example, if the key is the wrong size).
# 705 DecrypterNotFound
Raised when a message cannot be decrypted because there is no decrypter registered for the algorithm.
Connecting to Cloud
Unresolved include directive in modules/ref/pages/error-codes.adoc - include::7.6=@sdk:shared:partial$error-ref.adoc[]
ERROR:couchbase.connection:[2302468477383294429] <8676842d-4e8b-4c5b-a44f-e0886f8c0bc1.dp.cloud.couchbase.com:18091> (SOCK=a95ae0d1210d3132) Couldn't look up 8676842d-4e8b-4c5b-a44f-e0886f8c0bc1.dp.cloud.couchbase.com (nodename nor servname provided, or not known) [EAI=8] (L:503)
ERROR:couchbase.connection:[2302468477383294429] <8676842d-4e8b-4c5b-a44f-e0886f8c0bc1.dp.cloud.couchbase.com:18091> (SOCK=a95ae0d1210d3132) Failed to establish connection: LCB_ERR_UNKNOWN_HOST (1049), os errno=0 (L:164)
ERROR:couchbase.htconfig:[2302468477383294429] Connection to REST API failed with LCB_ERR_UNKNOWN_HOST (1049) (os errno = 0) (L:309)
INFO:couchbase.confmon:[2302468477383294429] Provider 'HTTP' failed: LCB_ERR_UNKNOWN_HOST (1049) (L:196)
Further Reading
-
Our practical look at error handling with the SDK.
-
Discussion document on handling exceptions.
-
Further reference material in the API Guide.