redis/redis-py · error · RedisClusterException

Cluster mode is not enabled on this node

Error message

Cluster mode is not enabled on this node

What it means

Error "Cluster mode is not enabled on this node" thrown in redis/redis-py.

Source

Thrown at redis/cluster.py:2700

                            **kwargs,
                        )
                        if startup_node in self.startup_nodes.values():
                            self.startup_nodes[startup_node.name].redis_connection = r
                        else:
                            startup_node.redis_connection = r
                    try:
                        # Make sure cluster mode is enabled on this node
                        cluster_slots = str_if_bytes(r.execute_command("CLUSTER SLOTS"))
                        if disconnect_startup_nodes_pools:
                            with r.connection_pool._lock:
                                # take care to clear connections before we move on
                                # mark all active connections for reconnect - they will be
                                # reconnected on next use, but will allow current in flight commands to complete first
                                r.connection_pool.update_active_connections_for_reconnect()
                                # Needed to clear READONLY state when it is no longer applicable
                                r.connection_pool.disconnect_free_connections()
                    except ResponseError:
                        raise RedisClusterException(
                            "Cluster mode is not enabled on this node"
                        )
                    startup_nodes_reachable = True
                except Exception as e:
                    # Try the next startup node.
                    # The exception is saved and raised only if we have no more nodes.
                    exception = e
                    continue

                # CLUSTER SLOTS command results in the following output:
                # [[slot_section[from_slot,to_slot,master,replica1,...,replicaN]]]
                # where each node contains the following list: [IP, port, node_id]
                # Therefore, cluster_slots[0][2][0] will be the IP address of the
                # primary node of the first slot section.
                # If there's only one server in the cluster, its ``host`` is ''
                # Fix it to the host in startup_nodes
                if (
                    len(cluster_slots) == 1

View on GitHub (pinned to da03cdc7e8)

When it happens

Trigger: Thrown at redis/cluster.py:2700 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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