{"record":{"id":"28387bde456a96e5","repo":"redis/jedis","slug":"no-cluster-nodes-available","errorCode":null,"errorMessage":"No cluster nodes available.","messagePattern":"No cluster nodes available\\.","errorType":"exception","errorClass":"JedisClusterOperationException","httpStatus":null,"severity":"critical","filePath":"src/main/java/redis/clients/jedis/executors/RoundRobinConnectionResolver.java","lineNumber":63,"sourceCode":"    ConnectionPool pool = selectedEntry.getValue();\n\n    return pool.getResource();\n  }\n\n  private List<Map.Entry<String, ConnectionPool>> selectConnectionPool(\n      ConnectionResolver.ConnectionIntent intent) {\n    Map<String, ConnectionPool> connectionMap;\n\n    if (intent == ConnectionResolver.ConnectionIntent.READ) {\n      // For keyless READ commands, use all nodes for load distribution\n      connectionMap = provider.getConnectionMap();\n    } else {\n      // Write operations always go to primary nodes\n      connectionMap = provider.getPrimaryNodesConnectionMap();\n    }\n\n    if (connectionMap.isEmpty()) {\n      throw new JedisClusterOperationException(\"No cluster nodes available.\");\n    }\n\n    return new ArrayList<>(connectionMap.entrySet());\n  }\n}\n","sourceCodeStart":45,"sourceCodeEnd":69,"githubUrl":"https://github.com/redis/jedis/blob/6dac31d4c224fb3257c216f3985340c6f500cdcb/src/main/java/redis/clients/jedis/executors/RoundRobinConnectionResolver.java#L45-L69","documentation":"RoundRobinConnectionResolver selects the pool of node connections used for cluster-wide (broadcast or read-from-replica) commands. It throws JedisClusterOperationException(\"No cluster nodes available.\") when the map of primary (or replica, for reads) node connections is empty. It means the client cannot find any eligible cluster node to route to.","triggerScenarios":"A keyless/broadcast command requiring primary nodes while the cluster reports no primaries; a read command routed to replicas when the connection map for replicas is empty (no replicas configured or all replica nodes unreachable/unregistered).","commonSituations":"Cluster with zero replicas while reading from replicas (misconfigured fromReplica/readFrom settings); node list empty because the topology hasn't been refreshed or all nodes are down; wrong startup nodes pointing at a dead cluster.","solutions":["If using read-from-replica, switch to reading from primaries (or configure at least one replica per master).","Verify cluster topology with `redis-cli cluster nodes` — ensure masters exist and slots are assigned.","Check that the startup node addresses in the client builder point to live cluster nodes and topology refresh is working.","Wait for/repair failed nodes so the connection map repopulates."],"exampleFix":"// before\nclient.setReadFrom(ReadFrom.REPLICA); // cluster has no replicas\n// after\nclient.setReadFrom(ReadFrom.PRIMARY);\n// or add a replica: redis-cli --cluster add-node <replica>:6379 <master>:6379 --cluster-slave","handlingStrategy":"validation","validationCode":"Map<String, ConnectionPool> nodes = provider.getPrimaryNodesConnectionMap();\nif (nodes == null || nodes.isEmpty()) {\n  throw new IllegalStateException(\"no cluster nodes configured; check startup nodes and topology\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  return broadcastCommand();\n} catch (JedisClusterOperationException e) {\n  if (e.getMessage().contains(\"No cluster nodes available\")) {\n    refreshTopology();\n    return broadcastCommand();\n  }\n  throw e;\n}","preventionTips":["Configure multiple startup nodes pointing at live masters","Match ReadFrom setting to actual replica topology","Run `cluster nodes` checks before deployments","Enable automatic topology refresh"],"tags":["cluster","topology","replica","routing"],"backgroundTag":"resource-not-found","analyzedSha":"6dac31d4c224fb3257c216f3985340c6f500cdcb","analyzedAt":"2026-09-08T04:55:01.204Z","contentChangedAt":"2026-09-08T04:55:01.204Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}