Exceptions#

exception redis.exceptions.AskError(resp, status_code=None)[source]#

Error indicated ASK error received from cluster. When a slot is set as MIGRATING, the node will accept all queries that pertain to this hash slot, but only if the key in question exists, otherwise the query is forwarded using a -ASK redirection to the node that is target of the migration.

src node: MIGRATING to dst node

get > ASK error ask dst node > ASKING command

dst node: IMPORTING from src node

asking command only affects next command any op will be allowed after asking command

Parameters

status_code (str) –

exception redis.exceptions.AuthenticationError(*args, status_code=None)[source]#
Parameters

status_code (str) –

exception redis.exceptions.AuthenticationWrongNumberOfArgsError(*args, status_code=None)[source]#

An error to indicate that the wrong number of args were sent to the AUTH command

Parameters

status_code (str) –

exception redis.exceptions.AuthorizationError(*args, status_code=None)[source]#
Parameters

status_code (str) –

exception redis.exceptions.BusyLoadingError(*args, status_code=None)[source]#
Parameters

status_code (str) –

exception redis.exceptions.ChildDeadlockedError[source]#

Error indicating that a child process is deadlocked after a fork()

exception redis.exceptions.ClusterCrossSlotError(*args, status_code=None)[source]#

Error indicated CROSSSLOT error received from cluster. A CROSSSLOT error is generated when keys in a request don’t hash to the same slot.

Parameters

status_code (str) –

exception redis.exceptions.ClusterDownError(resp, status_code=None)[source]#

Error indicated CLUSTERDOWN error received from cluster. By default Redis Cluster nodes stop accepting queries if they detect there is at least a hash slot uncovered (no available node is serving it). This way if the cluster is partially down (for example a range of hash slots are no longer covered) the entire cluster eventually becomes unavailable. It automatically returns available as soon as all the slots are covered again.

Parameters

status_code (str) –

exception redis.exceptions.ClusterError(*args, status_code=None)[source]#

Cluster errors occurred multiple times, resulting in an exhaustion of the command execution TTL

Parameters

status_code (str) –

exception redis.exceptions.ConnectionError(*args, status_code=None)[source]#
Parameters

status_code (str) –

exception redis.exceptions.CrossSlotTransactionError(*args)[source]#

Raised when a transaction or watch is triggered in a pipeline and not all keys or all commands belong to the same slot.

exception redis.exceptions.DataError(*args, status_code=None)[source]#
Parameters

status_code (str) –

class redis.exceptions.ExceptionType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
exception redis.exceptions.ExecAbortError(*args, status_code=None)[source]#
Parameters

status_code (str) –

exception redis.exceptions.ExternalAuthProviderError(*args, status_code=None)[source]#

Raised when an external authentication provider returns an error.

Parameters

status_code (str) –

exception redis.exceptions.IncorrectPolicyType[source]#

Raised when a policy type isn’t matching to any known policy types.

exception redis.exceptions.InvalidPipelineStack(*args)[source]#

Raised on unexpected response length on pipelines. This is most likely a handling error on the stack.

exception redis.exceptions.InvalidResponse(*args, status_code=None)[source]#
Parameters

status_code (str) –

exception redis.exceptions.LockError(message=None, lock_name=None)[source]#

Errors acquiring or releasing a lock

exception redis.exceptions.LockNotOwnedError(message=None, lock_name=None)[source]#

Error trying to extend or release a lock that is not owned (anymore)

exception redis.exceptions.MasterDownError(resp, status_code=None)[source]#

Error indicated MASTERDOWN error received from cluster. Link with MASTER is down and replica-serve-stale-data is set to ‘no’.

Parameters

status_code (str) –

exception redis.exceptions.MaxConnectionsError(*args, status_code=None)[source]#

Raised when a connection pool has reached its max_connections limit. This indicates pool exhaustion rather than an actual connection failure.

Parameters

status_code (str) –

exception redis.exceptions.ModuleError(*args, status_code=None)[source]#
Parameters

status_code (str) –

exception redis.exceptions.MovedError(resp, status_code=None)[source]#

Error indicated MOVED error received from cluster. A request sent to a node that doesn’t serve this key will be replayed with a MOVED error that points to the correct node.

Parameters

status_code (str) –

exception redis.exceptions.NoPermissionError(*args, status_code=None)[source]#
Parameters

status_code (str) –

exception redis.exceptions.NoScriptError(*args, status_code=None)[source]#
Parameters

status_code (str) –

exception redis.exceptions.OutOfMemoryError(*args, status_code=None)[source]#
Indicates the database is full. Can only occur when either:
  • Redis maxmemory-policy=noeviction

  • Redis maxmemory-policy=volatile* and there are no evictable keys

For more information see Memory optimization in Redis. # noqa

Parameters

status_code (str) –

exception redis.exceptions.PubSubError(*args, status_code=None)[source]#
Parameters

status_code (str) –

exception redis.exceptions.ReadOnlyError(*args, status_code=None)[source]#
Parameters

status_code (str) –

exception redis.exceptions.RedisClusterException(*args)[source]#

Base exception for the RedisCluster client

exception redis.exceptions.RedisError(*args, status_code=None)[source]#
Parameters

status_code (str) –

exception redis.exceptions.ResponseError(*args, status_code=None)[source]#
Parameters

status_code (str) –

exception redis.exceptions.SlotNotCoveredError(*args)[source]#

This error only happens in the case where the connection pool will try to fetch what node that is covered by a given slot.

If this error is raised the client should drop the current node layout and attempt to reconnect and refresh the node layout again

exception redis.exceptions.TimeoutError(*args, status_code=None)[source]#
Parameters

status_code (str) –

exception redis.exceptions.TryAgainError(*args, status_code=None, **kwargs)[source]#

Error indicated TRYAGAIN error received from cluster. Operations on keys that don’t exist or are - during resharding - split between the source and destination nodes, will generate a -TRYAGAIN error.

Parameters

status_code (str) –

exception redis.exceptions.WatchError(*args, status_code=None)[source]#
Parameters

status_code (str) –