Exceptions

Base classes and error contexts

AnalyticsErrorContext(**kwargs)

Details of a failed analytics query.

CouchbaseErrorCategory(value[, names, ...])

The category of an error.

CouchbaseException([message, context, ...])

The base class of the exceptions the SDK raises.

ErrorContext(**kwargs)

Details of the request that raised an exception.

ErrorContextType

Represent a PEP 604 union type

GenericErrorContext(**kwargs)

Details of a failure that belongs to no one service.

HTTPErrorContext(**kwargs)

Details of a failed HTTP request to a Couchbase service.

KeyValueErrorContext(**kwargs)

Details of a failed key-value operation.

ManagementErrorContext(**kwargs)

Details of a failed management request.

QueryErrorContext(**kwargs)

Details of a failed SQL++ query.

SearchErrorContext(**kwargs)

Details of a failed search query.

SubdocumentErrorContext(**kwargs)

Details of a failed sub-document operation.

TransactionsErrorContext(**kwargs)

Details of a failed transaction.

ViewErrorContext(**kwargs)

Details of a failed view query.

class couchbase.exceptions.AnalyticsErrorContext(**kwargs: Any)

Details of a failed analytics query.

property first_error_code: int | None

The code of the first error the analytics service reported.

property first_error_message: str | None

The message of the first error the analytics service reported.

property parameters: str | None

The parameters the statement was run with.

property statement: str | None

The statement that was run.

class couchbase.exceptions.CouchbaseErrorCategory(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

The category of an error.

analytics = 'couchbase.analytics'
common = 'couchbase.common'
key_value = 'couchbase.key_value'
management = 'couchbase.management'
network = 'couchbase.network'
other = 'other'
query = 'couchbase.query'
search = 'couchbase.search'
view = 'couchbase.view'
exception couchbase.exceptions.CouchbaseException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

The base class of the exceptions the SDK raises.

property context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext

The exception’s error context.

Deprecated since version 4.0.0: Use error_context instead.

property error_code: int | None

The error code behind the exception, if there is one.

property error_context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext

Details of the request that raised the exception.

property inner_cause: Exception | None

The exception that caused this one, if there was one.

VOLATILE This API is subject to change at any time.

property message: str | None

The exception’s message, if it has one.

VOLATILE This API is subject to change at any time.

class couchbase.exceptions.ErrorContext(**kwargs: Any)

Details of the request that raised an exception.

The fields here are on every context, and are None when the SDK did not record them. A subclass adds the fields one service reports.

static from_dict(**kwargs: Any) → ErrorContext

Build an error context from its fields.

Deprecated since version 4.7.0: Construct the context class directly instead.

property last_dispatched_from: str | None

The local address the request was last sent from.

property last_dispatched_to: str | None

The address of the node the request was last sent to.

property last_exception: str | None

The last error the request met before it failed.

property retry_attempts: int | None

How many times the request was retried.

property retry_reasons: set[str] | None

Why the request was retried.

couchbase.exceptions.ErrorContextType = couchbase.exceptions.AnalyticsErrorContext | couchbase.exceptions.ErrorContext | couchbase.exceptions.GenericErrorContext | couchbase.exceptions.HTTPErrorContext | couchbase.exceptions.KeyValueErrorContext | couchbase.exceptions.ManagementErrorContext | couchbase.exceptions.QueryErrorContext | couchbase.exceptions.SearchErrorContext | couchbase.exceptions.SubdocumentErrorContext | couchbase.exceptions.TransactionsErrorContext | couchbase.exceptions.ViewErrorContext

Represent a PEP 604 union type

E.g. for int | str

class couchbase.exceptions.GenericErrorContext(**kwargs: Any)

Details of a failure that belongs to no one service.

It has no fields beyond the ones every context carries.

class couchbase.exceptions.HTTPErrorContext(**kwargs: Any)

Details of a failed HTTP request to a Couchbase service.

property client_context_id: str | None

The client context ID the request was sent with.

property method: str | None

The HTTP method of the request.

property path: str | None

The path the request was sent to.

property response_body: str | None

The body of the response.

property response_code: int | None

The HTTP status code of the response.

class couchbase.exceptions.KeyValueErrorContext(**kwargs: Any)

Details of a failed key-value operation.

property bucket_name: str | None

The name of the bucket the document is in.

property collection_name: str | None

The name of the collection the document is in.

property key: str | None

The key of the document the operation targeted.

property scope_name: str | None

The name of the scope the document is in.

class couchbase.exceptions.ManagementErrorContext(**kwargs: Any)

Details of a failed management request.

property client_context_id: str | None

The client context ID the request was sent with.

property content: str | None

The body of the response.

property path: str | None

The path the request was sent to.

property response_code: int | None

The HTTP status code of the response.

class couchbase.exceptions.QueryErrorContext(**kwargs: Any)

Details of a failed SQL++ query.

property first_error_code: int | None

The code of the first error the query service reported.

property first_error_message: str | None

The message of the first error the query service reported.

property parameters: str | None

The parameters the statement was run with.

property statement: str | None

The statement that was run.

class couchbase.exceptions.SearchErrorContext(**kwargs: Any)

Details of a failed search query.

property index_name: str | None

The name of the search index that was queried.

property parameters: str | None

The parameters the query was sent with.

property query: str | None

The query that was sent.

class couchbase.exceptions.SubdocumentErrorContext(**kwargs: Any)

Details of a failed sub-document operation.

property deleted: bool

Whether the document the operation targeted is deleted.

property first_error_index: int | None

The index of the first spec that failed.

property first_error_path: str | None

The path of the first spec that failed.

class couchbase.exceptions.TransactionsErrorContext(**kwargs: Any)

Details of a failed transaction.

property failure_type: str | None

What kind of failure ended the transaction.

property last_dispatched_from: str | None

a transaction is not a single request.

Type:

Always None

property last_dispatched_to: str | None

a transaction is not a single request.

Type:

Always None

property retry_attempts: int | None

a transaction is not a single request.

Type:

Always None

property retry_reasons: set[str] | None

a transaction is not a single request.

Type:

Always None

class couchbase.exceptions.ViewErrorContext(**kwargs: Any)

Details of a failed view query.

property design_document_name: str | None

The name of the design document the view is in.

property query_string: str | None

The query string the request was sent with.

property view_name: str | None

The name of the view that was queried.

General

AmbiguousTimeoutException([message, ...])

Raised when an operation timed out and it cannot be established whether it mutated any data.

AuthenticationException([message, context, ...])

Raised when the cluster cannot authenticate the user.

AuthorizationFailureException([message, ...])

Indicates that the user authenticated but does not have permission to access the resource.

FeatureNotFoundException([message, context, ...])

Raised when a feature is used that the cluster's server version does not support.

FeatureUnavailableException([message, ...])

Raised when a feature is used that the cluster's server version does not support.

HTTPException([message, context, ...])

Raised when an HTTP request to a service fails.

InternalSDKException([message, context, ...])

Raised when the SDK has done something wrong.

InternalServerFailureException([message, ...])

Raised when a service reports an internal error.

InvalidArgumentException([message, context, ...])

Raised when an argument has an invalid value or type.

MissingConnectionException([message, ...])

Raised when an operation needs a connection the SDK does not have.

MissingTokenException([message, context, ...])

Raised when a MutationState is given no mutation token.

ParsingFailedException([message, context, ...])

Raised when a service cannot parse a query.

QuotaLimitedException([message, context, ...])

Raised when the server limits the caller for exceeding a quota threshold.

RateLimitedException([message, context, ...])

Raised when the server rate limits the caller for exceeding a rate threshold.

RequestCanceledException([message, context, ...])

Raised when a request is canceled before its outcome is known.

ServiceUnavailableException([message, ...])

Raised when the cluster has no node running the service a request needs.

TimeoutException([message, context, ...])

Raised when an operation times out.

UnAmbiguousTimeoutException([message, ...])

Raised when an operation timed out and it is certain that it did not mutate any data.

UnsuccessfulOperationException([message, ...])

Raised when the SDK cannot start an operation.

UnsupportedOperation([message, context, ...])

Raised when the server does not support an operation.

ValueFormatException([message, context, ...])

Raised when a transcoder cannot encode or decode a value.

exception couchbase.exceptions.AmbiguousTimeoutException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when an operation timed out and it cannot be established whether it mutated any data.

This usually means the request reached the server and the response did not arrive in time. A read-only operation never raises this; it raises UnAmbiguousTimeoutException instead.

exception couchbase.exceptions.AuthenticationException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when the cluster cannot authenticate the user.

exception couchbase.exceptions.AuthorizationFailureException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Indicates that the user authenticated but does not have permission to access the resource.

Only the couchbase2 protocol raises it. The classic protocol reports a missing permission as AuthenticationException.

exception couchbase.exceptions.FeatureNotFoundException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when a feature is used that the cluster’s server version does not support.

exception couchbase.exceptions.FeatureUnavailableException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when a feature is used that the cluster’s server version does not support.

exception couchbase.exceptions.HTTPException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when an HTTP request to a service fails.

exception couchbase.exceptions.InternalSDKException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when the SDK has done something wrong.

This does not rule out a mistake in the calling code, but the exception should never be seen. Contact Couchbase support.

exception couchbase.exceptions.InternalServerFailureException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when a service reports an internal error.

That is a 5xxx code from the query service, a 25xxx code from the analytics service, ERR_INTERNAL from the key-value service or HTTP 500 from the search service.

exception couchbase.exceptions.InvalidArgumentException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when an argument has an invalid value or type.

Warning

couchbase.options.InvalidArgumentException is deprecated, and will be removed in a future release. Import InvalidArgumentException from couchbase.exceptions.

exception couchbase.exceptions.MissingConnectionException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when an operation needs a connection the SDK does not have.

exception couchbase.exceptions.MissingTokenException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when a MutationState is given no mutation token.

exception couchbase.exceptions.ParsingFailedException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when a service cannot parse a query.

exception couchbase.exceptions.QuotaLimitedException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when the server limits the caller for exceeding a quota threshold.

UNCOMMITTED This API is unlikely to change, but may still change as final consensus on its behavior has not yet been reached.

exception couchbase.exceptions.RateLimitedException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when the server rate limits the caller for exceeding a rate threshold.

UNCOMMITTED This API is unlikely to change, but may still change as final consensus on its behavior has not yet been reached.

exception couchbase.exceptions.RequestCanceledException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when a request is canceled before its outcome is known.

This usually means the connection it was sent on closed.

exception couchbase.exceptions.ServiceUnavailableException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when the cluster has no node running the service a request needs.

For instance, a query against a cluster with no query node, or a view query against a memcached bucket.

exception couchbase.exceptions.TimeoutException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when an operation times out.

exception couchbase.exceptions.UnAmbiguousTimeoutException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when an operation timed out and it is certain that it did not mutate any data.

A read-only operation always raises this rather than AmbiguousTimeoutException. For a mutation, it usually means the SDK never sent the request, or the server reported that it failed.

exception couchbase.exceptions.UnsuccessfulOperationException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when the SDK cannot start an operation.

For instance, a range scan before the SDK has the cluster’s partition map.

exception couchbase.exceptions.UnsupportedOperation(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when the server does not support an operation.

exception couchbase.exceptions.ValueFormatException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when a transcoder cannot encode or decode a value.

Key-value

CASMismatchException

alias of CasMismatchException

CannotReviveLivingDocumentException([...])

Raised when reviving a document that is not deleted.

CasMismatchException([message, context, ...])

Raised when the CAS given to an operation does not match the document's.

DeltaInvalidException([message, context, ...])

Raised when the delta given to a counter operation is invalid.

DocumentExistsException([message, context, ...])

Raised when an operation expects a document not to exist, and it does.

DocumentLockedException([message, context, ...])

Raised when a document cannot be used because it is locked.

DocumentNotFoundException([message, ...])

Raised when the document an operation names does not exist.

DocumentNotFoundOnReplicaException([...])

Raised when the replica get_replica read from does not hold the document.

DocumentNotLockedException([message, ...])

Raised when unlocking a document that is not locked.

DocumentUnretrievableException([message, ...])

Raised when a replica read finds no copy of the document.

DurabilityImpossibleException([message, ...])

Raised when the durability an operation asks for cannot be achieved.

DurabilityInvalidLevelException([message, ...])

Raised when the server does not accept the durability level an operation asks for.

DurabilitySyncWriteAmbiguousException([...])

Raised when a durable write did not complete in time and its outcome is unknown.

DurabilitySyncWriteInProgressException([...])

Raised when mutating a document that has a durable write pending.

DurableWriteReCommitInProgressException([...])

Raised when the server is resynchronizing replicas for earlier durable writes.

MutationTokenOutdatedException([message, ...])

Raised when a mutation token's partition UUID does not match the server's.

RangeScanCompletedException([message, ...])

Raised when a range scan has already returned all of its items.

ReplicaIndexCurrentlyUnavailableException([...])

Raised when the replica get_replica asks for exists but cannot be read now.

ReplicaIndexOutOfBoundsException([message, ...])

Raised when get_replica asks for a replica index the bucket does not have.

TemporaryFailException([message, context, ...])

Raised when the server reports a temporary failure, for instance because it is busy.

ValueTooLargeException([message, context, ...])

Raised when a value is too large to store, typically over 20MB.

couchbase.exceptions.CASMismatchException

alias of CasMismatchException

exception couchbase.exceptions.CannotReviveLivingDocumentException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when reviving a document that is not deleted.

exception couchbase.exceptions.CasMismatchException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when the CAS given to an operation does not match the document’s.

The document changed after the CAS was read. Fetch it again and retry the operation.

exception couchbase.exceptions.DeltaInvalidException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when the delta given to a counter operation is invalid.

exception couchbase.exceptions.DocumentExistsException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when an operation expects a document not to exist, and it does.

exception couchbase.exceptions.DocumentLockedException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when a document cannot be used because it is locked.

exception couchbase.exceptions.DocumentNotFoundException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when the document an operation names does not exist.

exception couchbase.exceptions.DocumentNotFoundOnReplicaException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when the replica get_replica read from does not hold the document.

It is a DocumentNotFoundException, so code that handles a missing document handles this too.

exception couchbase.exceptions.DocumentNotLockedException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when unlocking a document that is not locked.

exception couchbase.exceptions.DocumentUnretrievableException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when a replica read finds no copy of the document.

exception couchbase.exceptions.DurabilityImpossibleException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when the durability an operation asks for cannot be achieved.

For instance, the bucket has fewer replicas than the durability level requires.

exception couchbase.exceptions.DurabilityInvalidLevelException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when the server does not accept the durability level an operation asks for.

exception couchbase.exceptions.DurabilitySyncWriteAmbiguousException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when a durable write did not complete in time and its outcome is unknown.

It may yet succeed or fail.

exception couchbase.exceptions.DurabilitySyncWriteInProgressException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when mutating a document that has a durable write pending.

Retrying, possibly with a backoff, usually succeeds.

exception couchbase.exceptions.DurableWriteReCommitInProgressException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when the server is resynchronizing replicas for earlier durable writes.

This typically follows a rebalance.

exception couchbase.exceptions.MutationTokenOutdatedException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when a mutation token’s partition UUID does not match the server’s.

exception couchbase.exceptions.RangeScanCompletedException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when a range scan has already returned all of its items.

exception couchbase.exceptions.ReplicaIndexCurrentlyUnavailableException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when the replica get_replica asks for exists but cannot be read now.

The cluster map does not yet place that replica on a node, typically during a rebalance, which resolves it. Pass wrap=True to from_index() to read another replica instead.

exception couchbase.exceptions.ReplicaIndexOutOfBoundsException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when get_replica asks for a replica index the bucket does not have.

The index is at or beyond the bucket’s configured number of replicas, or the bucket has none. It is raised without a network round trip, and retrying cannot help. Pass wrap=True to from_index() to read a different replica instead.

exception couchbase.exceptions.TemporaryFailException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when the server reports a temporary failure, for instance because it is busy.

Retrying the operation later is likely to succeed.

exception couchbase.exceptions.ValueTooLargeException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when a value is too large to store, typically over 20MB.

Sub-document

DocumentNotJsonException([message, context, ...])

Raised when a sub-document operation targets a document that is not JSON.

DocumentTooDeepException([message, context, ...])

Raised when a sub-document operation meets a document with too many levels to parse.

InvalidValueException([message, context, ...])

Raised when a value is not valid for the operation it is given to.

NoChildrenException([message])

Raised when a search query is given none of the IDs, terms or child queries it needs.

NumberTooBigException([message, context, ...])

Raised when a sub-document counter targets a number outside the range arithmetic supports.

PathExistsException([message, context, ...])

Raised when a sub-document operation expects a path not to exist, and it does.

PathInvalidException([message, context, ...])

Raised when a sub-document path is not syntactically valid.

PathMismatchException([message, context, ...])

Raised when a sub-document path assumes the wrong structure for the document.

PathNotFoundException([message, context, ...])

Raised when a sub-document path does not exist in the document.

PathTooBigException([message, context, ...])

Raised when a sub-document path is too long or has too many components.

PathTooDeepException([message, context, ...])

Raised when a sub-document path has too many levels to parse.

SubdocCantInsertValueException

alias of InvalidValueException

SubdocPathMismatchException

alias of PathMismatchException

ValueTooDeepException([message, context, ...])

Raised when inserting a value would make the document too deep for the server to accept.

XattrCannotModifyVirtualAttributeException([...])

Raised when a sub-document operation modifies a virtual attribute.

XattrInvalidKeyComboException([message, ...])

Raised when one sub-document operation accesses more than one extended attribute.

XattrNoAccessException([message, context, ...])

Raised when accessing a system extended attribute without permission.

XattrUnknownMacroException([message, ...])

Raised when a sub-document operation uses a macro the server does not know.

XattrUnknownVirtualAttributeException([...])

Raised when a sub-document operation accesses an unknown virtual attribute.

exception couchbase.exceptions.DocumentNotJsonException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when a sub-document operation targets a document that is not JSON.

exception couchbase.exceptions.DocumentTooDeepException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when a sub-document operation meets a document with too many levels to parse.

exception couchbase.exceptions.InvalidValueException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when a value is not valid for the operation it is given to.

exception couchbase.exceptions.NoChildrenException(message: str = 'No child queries.', **kwargs: Unpack[_ExceptionKwargs])

Raised when a search query is given none of the IDs, terms or child queries it needs.

Warning

couchbase.search.NoChildrenException is deprecated, and will be removed in a future release. Import NoChildrenException from couchbase.exceptions.

exception couchbase.exceptions.NumberTooBigException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when a sub-document counter targets a number outside the range arithmetic supports.

exception couchbase.exceptions.PathExistsException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when a sub-document operation expects a path not to exist, and it does.

exception couchbase.exceptions.PathInvalidException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when a sub-document path is not syntactically valid.

exception couchbase.exceptions.PathMismatchException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when a sub-document path assumes the wrong structure for the document.

For instance, it treats a field as an object when it is an array.

exception couchbase.exceptions.PathNotFoundException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when a sub-document path does not exist in the document.

exception couchbase.exceptions.PathTooBigException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when a sub-document path is too long or has too many components.

exception couchbase.exceptions.PathTooDeepException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when a sub-document path has too many levels to parse.

couchbase.exceptions.SubdocCantInsertValueException

alias of InvalidValueException

couchbase.exceptions.SubdocPathMismatchException

alias of PathMismatchException

exception couchbase.exceptions.ValueTooDeepException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when inserting a value would make the document too deep for the server to accept.

exception couchbase.exceptions.XattrCannotModifyVirtualAttributeException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when a sub-document operation modifies a virtual attribute.

exception couchbase.exceptions.XattrInvalidKeyComboException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when one sub-document operation accesses more than one extended attribute.

exception couchbase.exceptions.XattrNoAccessException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when accessing a system extended attribute without permission.

A system attribute’s name starts with an underscore, and accessing one needs the SystemXattrRead or SystemXattrWrite privilege.

exception couchbase.exceptions.XattrUnknownMacroException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when a sub-document operation uses a macro the server does not know.

exception couchbase.exceptions.XattrUnknownVirtualAttributeException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when a sub-document operation accesses an unknown virtual attribute.

Management

AnalyticsLinkExistsException([message, ...])

Raised when creating an analytics link that already exists.

AnalyticsLinkNotFoundException([message, ...])

Raised when the analytics link a request names does not exist.

BucketAlreadyExistsException([message, ...])

Raised when creating a bucket that already exists.

BucketDoesNotExistException([message, ...])

Raised when a bucket management operation names a bucket that does not exist.

BucketNotFlushableException([message, ...])

Raised when flushing a bucket that does not have flush enabled.

BucketNotFoundException([message, context, ...])

Raised when the bucket a request names does not exist.

CollectionAlreadyExistsException([message, ...])

Raised when creating a collection that already exists.

CollectionNotFoundException([message, ...])

Raised when the collection a request names does not exist.

DatasetAlreadyExistsException([message, ...])

Raised when creating an analytics dataset that already exists.

DatasetNotFoundException([message, context, ...])

Raised when the analytics dataset a request names does not exist.

DataverseAlreadyExistsException([message, ...])

Raised when creating an analytics dataverse that already exists.

DataverseNotFoundException([message, ...])

Raised when the analytics dataverse a request names does not exist.

EventingFunctionAlreadyDeployedException([...])

Raised when deploying an eventing function that is already deployed.

EventingFunctionCollectionNotFoundException([...])

Raised when a collection in an eventing function's keyspace does not exist.

EventingFunctionCompilationFailureException([...])

Raised when an eventing function does not compile.

EventingFunctionIdenticalKeyspaceException([...])

Raised when an eventing function's source and metadata keyspaces are the same.

EventingFunctionNotBootstrappedException([...])

Raised when an eventing function is deployed but not fully bootstrapped.

EventingFunctionNotDeployedException([...])

Raised when an operation needs an eventing function deployed, and it is not.

EventingFunctionNotFoundException([message, ...])

Raised when the eventing function a request names does not exist.

EventingFunctionNotUnDeployedException([...])

Raised when an operation needs an eventing function undeployed, and it is not.

GroupNotFoundException([message, context, ...])

Raised when the RBAC group a request names does not exist.

ScopeAlreadyExistsException([message, ...])

Raised when creating a scope that already exists.

ScopeNotFoundException([message, context, ...])

Raised when the scope a request names does not exist.

SearchIndexNotFoundException([message, ...])

Raised when the search index a request names does not exist.

UserNotFoundException([message, context, ...])

Raised when the RBAC user a request names does not exist.

exception couchbase.exceptions.AnalyticsLinkExistsException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when creating an analytics link that already exists.

exception couchbase.exceptions.AnalyticsLinkNotFoundException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when the analytics link a request names does not exist.

exception couchbase.exceptions.BucketAlreadyExistsException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when creating a bucket that already exists.

exception couchbase.exceptions.BucketDoesNotExistException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when a bucket management operation names a bucket that does not exist.

exception couchbase.exceptions.BucketNotFlushableException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when flushing a bucket that does not have flush enabled.

exception couchbase.exceptions.BucketNotFoundException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when the bucket a request names does not exist.

exception couchbase.exceptions.CollectionAlreadyExistsException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when creating a collection that already exists.

exception couchbase.exceptions.CollectionNotFoundException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when the collection a request names does not exist.

exception couchbase.exceptions.DatasetAlreadyExistsException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when creating an analytics dataset that already exists.

exception couchbase.exceptions.DatasetNotFoundException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when the analytics dataset a request names does not exist.

exception couchbase.exceptions.DataverseAlreadyExistsException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when creating an analytics dataverse that already exists.

exception couchbase.exceptions.DataverseNotFoundException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when the analytics dataverse a request names does not exist.

exception couchbase.exceptions.EventingFunctionAlreadyDeployedException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when deploying an eventing function that is already deployed.

exception couchbase.exceptions.EventingFunctionCollectionNotFoundException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when a collection in an eventing function’s keyspace does not exist.

exception couchbase.exceptions.EventingFunctionCompilationFailureException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when an eventing function does not compile.

exception couchbase.exceptions.EventingFunctionIdenticalKeyspaceException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when an eventing function’s source and metadata keyspaces are the same.

exception couchbase.exceptions.EventingFunctionNotBootstrappedException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when an eventing function is deployed but not fully bootstrapped.

exception couchbase.exceptions.EventingFunctionNotDeployedException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when an operation needs an eventing function deployed, and it is not.

exception couchbase.exceptions.EventingFunctionNotFoundException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when the eventing function a request names does not exist.

exception couchbase.exceptions.EventingFunctionNotUnDeployedException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when an operation needs an eventing function undeployed, and it is not.

exception couchbase.exceptions.GroupNotFoundException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when the RBAC group a request names does not exist.

exception couchbase.exceptions.ScopeAlreadyExistsException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when creating a scope that already exists.

exception couchbase.exceptions.ScopeNotFoundException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when the scope a request names does not exist.

exception couchbase.exceptions.SearchIndexNotFoundException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when the search index a request names does not exist.

exception couchbase.exceptions.UserNotFoundException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when the RBAC user a request names does not exist.

Transactions

TransactionCommitAmbiguous([message, ...])

Raised when a transaction expired while committing, so whether it committed is unknown.

TransactionException([message, context, ...])

The base class of the exceptions a transaction raises.

TransactionExpired([message, context, ...])

Raised when a transaction did not complete within its timeout, and was rolled back.

TransactionFailed([message, context, ...])

Raised when a transaction failed and was rolled back.

TransactionOperationFailed([message, ...])

Raised when an operation in a transaction fails.

exception couchbase.exceptions.TransactionCommitAmbiguous(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when a transaction expired while committing, so whether it committed is unknown.

Actors may be able to see the changes it made.

This is an unavoidable edge case of unreliable networks. A mutation can succeed on the server and its response be lost when the connection drops, so the client times out without knowing the outcome. The transactions layer works to resolve the ambiguity until the transaction expires, and raises this when it cannot. How to handle it depends on the application.

The asynchronous cleanup process completes the transaction: it rolls it back if it did not commit, and forwards if it did.

exception couchbase.exceptions.TransactionException(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

The base class of the exceptions a transaction raises.

exception couchbase.exceptions.TransactionExpired(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when a transaction did not complete within its timeout, and was rolled back.

It unambiguously did not reach the commit point, so no actor can see any change it made.

exception couchbase.exceptions.TransactionFailed(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when a transaction failed and was rolled back.

No actor can see any change the transaction made.

exception couchbase.exceptions.TransactionOperationFailed(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when an operation in a transaction fails.

The transaction is rolled back whatever happens next; this exception says why the operation failed.

Encryption

CryptoException([message])

The base class of the field-level encryption exceptions.

CryptoKeyNotFoundException([message])

Raised when a keyring has no key with the requested ID, or an encryption result has no such field.

DecrypterAlreadyExistsException([message])

Raised when registering a decrypter for an algorithm that already has one.

DecrypterNotFoundException([message])

Raised when a crypto manager has no decrypter for an encryption algorithm.

DecryptionFailureException([message])

Raised when a crypto manager fails to decrypt a value.

EncrypterAlreadyExistsException([message])

Raised when registering an encrypter under an alias that already has one.

EncrypterNotFoundException([message])

Raised when a crypto manager has no encrypter under the requested alias.

EncryptionFailureException([message])

Raised when a crypto manager fails to encrypt a value.

InvalidCipherTextException([message])

Raised when a decrypter is given ciphertext it cannot decrypt.

InvalidCryptoKeyException([message])

Raised when an encrypter or decrypter is given a key it cannot use.

exception couchbase.exceptions.CryptoException(message: str | None = 'Generic Cryptography exception', **kwargs: Unpack[_ExceptionKwargs])

The base class of the field-level encryption exceptions.

exception couchbase.exceptions.CryptoKeyNotFoundException(message: str | None = 'Generic Cryptography exception', **kwargs: Unpack[_ExceptionKwargs])

Raised when a keyring has no key with the requested ID, or an encryption result has no such field.

exception couchbase.exceptions.DecrypterAlreadyExistsException(message: str | None = 'Generic Cryptography exception', **kwargs: Unpack[_ExceptionKwargs])

Raised when registering a decrypter for an algorithm that already has one.

exception couchbase.exceptions.DecrypterNotFoundException(message: str | None = 'Generic Cryptography exception', **kwargs: Unpack[_ExceptionKwargs])

Raised when a crypto manager has no decrypter for an encryption algorithm.

exception couchbase.exceptions.DecryptionFailureException(message: str | None = 'Generic Decryption exception', **kwargs: Unpack[_ExceptionKwargs])

Raised when a crypto manager fails to decrypt a value.

exception couchbase.exceptions.EncrypterAlreadyExistsException(message: str | None = 'Generic Cryptography exception', **kwargs: Unpack[_ExceptionKwargs])

Raised when registering an encrypter under an alias that already has one.

exception couchbase.exceptions.EncrypterNotFoundException(message: str | None = 'Generic Cryptography exception', **kwargs: Unpack[_ExceptionKwargs])

Raised when a crypto manager has no encrypter under the requested alias.

exception couchbase.exceptions.EncryptionFailureException(message: str | None = 'Generic Encryption exception', **kwargs: Unpack[_ExceptionKwargs])

Raised when a crypto manager fails to encrypt a value.

exception couchbase.exceptions.InvalidCipherTextException(message: str | None = 'Generic Cryptography exception', **kwargs: Unpack[_ExceptionKwargs])

Raised when a decrypter is given ciphertext it cannot decrypt.

exception couchbase.exceptions.InvalidCryptoKeyException(message: str | None = 'Generic Cryptography exception', **kwargs: Unpack[_ExceptionKwargs])

Raised when an encrypter or decrypter is given a key it cannot use.

Datastructures

QueueEmpty([message, context, error_code, ...])

Raised when popping from an empty CouchbaseQueue.

exception couchbase.exceptions.QueueEmpty(message: str | None = None, *, context: AnalyticsErrorContext | ErrorContext | GenericErrorContext | HTTPErrorContext | KeyValueErrorContext | ManagementErrorContext | QueryErrorContext | SearchErrorContext | SubdocumentErrorContext | TransactionsErrorContext | ViewErrorContext | None = None, error_code: int | None = None, category: str | None = None, exc_info: _ExceptionInfo | None = None)

Raised when popping from an empty CouchbaseQueue.