redis/redis-py · error · SlotNotCoveredError
Slot " " not covered by the cluster. "require_full_coverage=
Error message
Slot "{slot}" not covered by the cluster. "require_full_coverage={self._require_full_coverage}" What it means
Raised as a SlotNotCoveredError by NodesManager.get_node_from_slot() (the internal slot-to-node resolver used during command execution) when the requested slot is absent from slots_cache. Unlike error 201 (get_node_from_key on the public API), this fires in the hot command-execution path and includes the require_full_coverage setting in the message, helping diagnose whether the client is operating in degraded-coverage mode. See cluster.py:2403-2407.
Solutions
- Allow the client's built-in retry/topology refresh to handle transient gaps (the retry loop in _internal_execute_command catches ERRORS_ALLOW_RETRY including SlotNotCoveredError).
- Increase reinitialize_steps so topology refresh is triggered on slot errors, or set require_full_coverage=True if you need the client to fail fast on startup rather than at command time.
- Verify cluster health: ensure all 16384 slots are covered (CLUSTER NODES) and all primaries are reachable.
Example fix
// before
client = RedisCluster(host, port, require_full_coverage=False)
client.get('key_in_uncovered_slot')
// after (let retry handle it, or force full coverage)
client = RedisCluster(host, port, require_full_coverage=True) Defensive patterns
Strategy: retry
Validate before calling
# Check slot coverage for a key before executing
slot = client.keyslot('mykey')
if not client.nodes_manager.slots_cache.get(slot):
client.cluster_reload_slots() Type guard
def slot_is_routable(client, slot: int) -> bool:
cache = client.nodes_manager.slots_cache.get(slot)
return cache is not None and len(cache) > 0 Try / catch
from redis.exceptions import SlotNotCoveredError
try:
val = client.get('mykey')
except SlotNotCoveredError:
client.cluster_reload_slots()
val = client.get('mykey') Prevention
- Rely on the client's built-in retry loop which catches SlotNotCoveredError and refreshes topology.
- Set reinitialize_steps > 0 so MOVED/slot errors trigger topology refresh.
- Use require_full_coverage=True to detect slot gaps at startup.
When it happens
Trigger: Executing any keyed command routed to a slot that has no entry in slots_cache during _execute_command -> determine_slot -> get_node_from_slot. Happens when a slot is not assigned to any node in the client's topology view.
Common situations: Cluster is undergoing resharding/failover, topology refresh is stale, a primary for the slot is down and the slot has not been picked up yet, or require_full_coverage=False was set to tolerate gaps but a command hit an uncovered slot.
Related errors
- Slot " " is not covered by the cluster.
- Failed to subscribe to cluster nodes
- shard channel(s) left unreconciled; slot(s) not covered by…
- All slots are not covered after query all startup_nodes.
- Cannot set active database, database is unhealthy
AI-assisted analysis of redis/redis-py@6a6b581b48 (2026-08-10).
Data as JSON: /api/errors/53f48c5354c9ab74.
Report an issue: GitHub.
Appendix: source
Thrown at redis/cluster.py:2404
version="5.3.0",
)
def get_node_from_slot(
self,
slot: int,
read_from_replicas: bool = False,
load_balancing_strategy: Optional[LoadBalancingStrategy] = None,
server_type: Optional[Literal["primary", "replica"]] = None,
) -> ClusterNode:
"""
Gets a node that servers this hash slot
"""
if read_from_replicas is True and load_balancing_strategy is None:
load_balancing_strategy = LoadBalancingStrategy.ROUND_ROBIN
with self._lock:
if self.slots_cache.get(slot) is None or len(self.slots_cache[slot]) == 0:
raise SlotNotCoveredError(
f'Slot "{slot}" not covered by the cluster. '
+ f'"require_full_coverage={self._require_full_coverage}"'
)
if len(self.slots_cache[slot]) > 1 and load_balancing_strategy:
# get the server index using the strategy defined in load_balancing_strategy
primary_name = self.slots_cache[slot][0].name
node_idx = self.read_load_balancer.get_server_index(
primary_name, len(self.slots_cache[slot]), load_balancing_strategy
)
elif (
server_type is None
or server_type == PRIMARY
or len(self.slots_cache[slot]) == 1
):
# return a primary
node_idx = 0
else:View on GitHub (pinned to 6a6b581b48)