redis/redis-py · error · RedisClusterException

startup_nodes could not agree on a valid slots cache: {', '.

Error message

startup_nodes could not agree on a valid slots cache: {', '.join(disagreements)}

What it means

Error "startup_nodes could not agree on a valid slots cache: {', '.join(disagreements)}" thrown in redis/redis-py.

Source

Thrown at redis/cluster.py:2762

                        target_replica_node = self._get_or_create_cluster_node(
                            host, port, REPLICA, tmp_nodes_cache
                        )
                        nodes_for_slot.append(target_replica_node)

                    for i in range(int(slot[0]), int(slot[1]) + 1):
                        if i not in tmp_slots:
                            tmp_slots[i] = nodes_for_slot
                        else:
                            # Validate that 2 nodes want to use the same slot cache
                            # setup
                            tmp_slot = tmp_slots[i][0]
                            if tmp_slot.name != target_node.name:
                                disagreements.append(
                                    f"{tmp_slot.name} vs {target_node.name} on slot: {i}"
                                )

                                if len(disagreements) > 5:
                                    raise RedisClusterException(
                                        f"startup_nodes could not agree on a valid "
                                        f"slots cache: {', '.join(disagreements)}"
                                    )

                fully_covered = self.check_slots_coverage(tmp_slots)
                if fully_covered:
                    # Don't need to continue to the next startup node if all
                    # slots are covered
                    break

            if not startup_nodes_reachable:
                raise RedisClusterException(
                    f"Redis Cluster cannot be connected. Please provide at least "
                    f"one reachable node: {str(exception)}"
                ) from exception

            # Create Redis connections to all nodes
            self.create_redis_connections(list(tmp_nodes_cache.values()))

View on GitHub (pinned to da03cdc7e8)

When it happens

Trigger: Thrown at redis/cluster.py:2762 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/819a9b6c83b37b63.json. Report an issue: GitHub.