{"record":{"id":"53f48c5354c9ab74","repo":"redis/redis-py","slug":"slot-slot-not-covered-by-the-cluster-require-53f48c","errorCode":null,"errorMessage":"Slot \"{slot}\" not covered by the cluster. \"require_full_coverage={self._require_full_coverage}\"","messagePattern":"Slot \"(.+?)\" not covered by the cluster\\. \"require_full_coverage=(.+?)\"","errorType":"exception","errorClass":"SlotNotCoveredError","httpStatus":null,"severity":"error","filePath":"redis/cluster.py","lineNumber":2404,"sourceCode":"        version=\"5.3.0\",\n    )\n    def get_node_from_slot(\n        self,\n        slot: int,\n        read_from_replicas: bool = False,\n        load_balancing_strategy: Optional[LoadBalancingStrategy] = None,\n        server_type: Optional[Literal[\"primary\", \"replica\"]] = None,\n    ) -> ClusterNode:\n        \"\"\"\n        Gets a node that servers this hash slot\n        \"\"\"\n\n        if read_from_replicas is True and load_balancing_strategy is None:\n            load_balancing_strategy = LoadBalancingStrategy.ROUND_ROBIN\n\n        with self._lock:\n            if self.slots_cache.get(slot) is None or len(self.slots_cache[slot]) == 0:\n                raise SlotNotCoveredError(\n                    f'Slot \"{slot}\" not covered by the cluster. '\n                    + f'\"require_full_coverage={self._require_full_coverage}\"'\n                )\n\n            if len(self.slots_cache[slot]) > 1 and load_balancing_strategy:\n                # get the server index using the strategy defined in load_balancing_strategy\n                primary_name = self.slots_cache[slot][0].name\n                node_idx = self.read_load_balancer.get_server_index(\n                    primary_name, len(self.slots_cache[slot]), load_balancing_strategy\n                )\n            elif (\n                server_type is None\n                or server_type == PRIMARY\n                or len(self.slots_cache[slot]) == 1\n            ):\n                # return a primary\n                node_idx = 0\n            else:","sourceCodeStart":2386,"sourceCodeEnd":2422,"githubUrl":"https://github.com/redis/redis-py/blob/6a6b581b48225afa0b76912d1028c6035baee932/redis/cluster.py#L2386-L2422","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nclient = RedisCluster(host, port, require_full_coverage=False)\nclient.get('key_in_uncovered_slot')\n\n// after (let retry handle it, or force full coverage)\nclient = RedisCluster(host, port, require_full_coverage=True)","handlingStrategy":"retry","validationCode":"# Check slot coverage for a key before executing\nslot = client.keyslot('mykey')\nif not client.nodes_manager.slots_cache.get(slot):\n    client.cluster_reload_slots()","typeGuard":"def slot_is_routable(client, slot: int) -> bool:\n    cache = client.nodes_manager.slots_cache.get(slot)\n    return cache is not None and len(cache) > 0","tryCatchPattern":"from redis.exceptions import SlotNotCoveredError\ntry:\n    val = client.get('mykey')\nexcept SlotNotCoveredError:\n    client.cluster_reload_slots()\n    val = client.get('mykey')","preventionTips":["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."],"tags":["slot-coverage","topology","command-execution","failover"],"backgroundTag":null,"analyzedSha":"6a6b581b48225afa0b76912d1028c6035baee932","analyzedAt":"2026-08-10T12:52:44.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}