redis/redis-py · error · NotImplementedError

CLUSTER BUMPEPOCH is intentionally not implemented in the cl

Error message

CLUSTER BUMPEPOCH is intentionally not implemented in the client.

What it means

cluster_bumpepoch() unconditionally raises NotImplementedError. The client intentionally does not expose CLUSTER BUMPEPOCH; bumping the cluster config epoch is an internal failover/consensus operation that is unsafe to trigger casually, so the maintainers chose not to implement it. No argument makes it succeed.

Source

Thrown at redis/commands/cluster.py:1026

    ) -> ClusterLinksResponse | Awaitable[ClusterLinksResponse]:
        """
        Each node in a Redis Cluster maintains a pair of long-lived TCP link with each
        peer in the cluster: One for sending outbound messages towards the peer and one
        for receiving inbound messages from the peer.

        This command outputs information of all such peer links as an array.

        For more information see https://redis.io/commands/cluster-links
        """
        return self.execute_command("CLUSTER LINKS", target_nodes=target_node)

    def cluster_flushslots(self, target_nodes: "TargetNodesT" | None = None) -> None:
        raise NotImplementedError(
            "CLUSTER FLUSHSLOTS is intentionally not implemented in the client."
        )

    def cluster_bumpepoch(self, target_nodes: "TargetNodesT" | None = None) -> None:
        raise NotImplementedError(
            "CLUSTER BUMPEPOCH is intentionally not implemented in the client."
        )

    def readonly(self, target_nodes: "TargetNodesT" | None = None) -> ResponseT:
        """
        Enables read queries.
        The command will be sent to the default cluster node if target_nodes is
        not specified.

        For more information see https://redis.io/commands/readonly
        """
        if target_nodes == "replicas" or target_nodes == "all":
            # read_from_replicas will only be enabled if the READONLY command
            # is sent to all replicas
            self.read_from_replicas = True
        return self.execute_command("READONLY", target_nodes=target_nodes)

    def readwrite(self, target_nodes: "TargetNodesT" | None = None) -> ResponseT:

View on GitHub (pinned to da03cdc7e8)

Solutions

  1. Do not call cluster_bumpepoch — it is intentionally not implemented.
  2. If you genuinely need it, run the raw command via r.execute_command('CLUSTER', 'BUMPEPOCH') against a target node, accepting it is an admin-only operation.
  3. Re-evaluate whether you need BUMPEPOCH at all — normal failover handles epoch propagation automatically.

Example fix

# before
r.cluster_bumpepoch()
# after (only if you accept the risk)
r.execute_command('CLUSTER', 'BUMPEPOCH')
Defensive patterns

Strategy: validation

Validate before calling

# No valid argument exists. Avoid the method entirely:
# cluster_bumpepoch is intentionally unsupported on the cluster client.
pass  # do not call client.cluster_bumpepoch()

Type guard

def supports_cluster_bumpepoch(client) -> bool:
    return False  # always raises NotImplementedError

Try / catch

try:
    client.cluster_bumpepoch()
except NotImplementedError:
    client.execute_command('CLUSTER', 'BUMPEPOCH')  # only if you accept the risk

Prevention

When it happens

Trigger: Calling r.cluster_bumpepoch() on a RedisCluster client (sync or async). The method body at redis/commands/cluster.py:1025-1028 always raises.

Common situations: Seeing the method in autocomplete; following a tutorial that mentions BUMPEPOCH; failover/recovery scripts ported from redis-cli that try to force epoch advancement.

Related errors


AI-assisted analysis of redis/redis-py@da03cdc7e8 (2026-08-04). Data as JSON: /data/errors/4a266e2e80dc8f39.json. Report an issue: GitHub.