{"record":{"id":"ee3cccbd23bbd3df","repo":"redis/jedis","slug":"all-sentinels-down-cannot-determine-where-maste","errorCode":null,"errorMessage":"All sentinels down, cannot determine where ${masterName} is running.","messagePattern":"All sentinels down, cannot determine where (.+?) is running\\.","errorType":"exception","errorClass":"JedisConnectionException","httpStatus":null,"severity":"critical","filePath":"src/main/java/redis/clients/jedis/providers/SentineledConnectionProvider.java","lineNumber":286,"sourceCode":"        }\n\n        master = toHostAndPort(masterAddr);\n        LOG.debug(\"Redis master reported at {}.\", master);\n        break;\n      } catch (JedisException e) {\n        // resolves #1036, it should handle JedisException there's another chance\n        // of raising JedisDataException\n        LOG.warn(\"Could not get master address from {}.\", sentinel, e);\n      }\n    }\n\n    if (master == null) {\n      if (sentinelAvailable) {\n        // can connect to sentinel, but master name seems to not monitored\n        throw new JedisException(\n            \"Can connect to sentinel, but \" + masterName + \" seems to be not monitored.\");\n      } else {\n        throw new JedisConnectionException(\n            \"All sentinels down, cannot determine where \" + masterName + \" is running.\");\n      }\n    }\n\n    LOG.info(\"Redis master running at {}. Starting sentinel listeners...\", master);\n\n    for (HostAndPort sentinel : sentinels) {\n\n      SentinelListener listener = new SentinelListener(sentinel);\n      // whether SentinelListener threads are alive or not, process can be stopped\n      listener.setDaemon(true);\n      sentinelListeners.add(listener);\n      listener.start();\n    }\n\n    return master;\n  }\n","sourceCodeStart":268,"sourceCodeEnd":304,"githubUrl":"https://github.com/redis/jedis/blob/6dac31d4c224fb3257c216f3985340c6f500cdcb/src/main/java/redis/clients/jedis/providers/SentineledConnectionProvider.java#L268-L304","documentation":"SentineledConnectionProvider.initSentinels() failed to connect to every configured sentinel, so it cannot discover where the master is running and throws JedisConnectionException. Unlike the 'not monitored' case, no sentinel was reachable at all (sentinelAvailable is false).","triggerScenarios":"Building a sentinel-based client where all sentinel HostAndPort endpoints are unreachable: wrong ports, hosts down, firewall/network partition, or sentinels bound to interfaces not reachable from the client.","commonSituations":"Kubernetes/Docker network misconfiguration so the client cannot reach sentinel pods; stale sentinel endpoints after a deployment; firewall or security-group blocking port 26379; sentinels crashed and DNS still resolves old addresses.","solutions":["Verify each sentinel endpoint with redis-cli -h <host> -p 26379 ping and fix the endpoints list.","Check network/firewall rules (security groups, NetworkPolicy) allow the client to reach sentinel ports.","Restart or replace the sentinel processes and update the client's sentinel set with current addresses.","Confirm the client is using the correct environment's sentinel hosts (not decommissioned ones)."],"exampleFix":"// before\nSet<HostAndPort> sentinels = Set.of(new HostAndPort(\"10.0.0.5\", 26379)); // host gone\n// after\nSet<HostAndPort> sentinels = Set.of(\n  new HostAndPort(\"sentinel-0.svc\", 26379),\n  new HostAndPort(\"sentinel-1.svc\", 26379),\n  new HostAndPort(\"sentinel-2.svc\", 26379));","handlingStrategy":"retry","validationCode":"for (HostAndPort hp : sentinels) {\n  try (Jedis s = new Jedis(hp.getHost(), hp.getPort(), 2000)) { s.ping(); }\n  catch (Exception e) { throw new IllegalStateException(\"Sentinel unreachable: \" + hp, e); }\n}","typeGuard":null,"tryCatchPattern":"try {\n  pool = new JedisSentinelPool(masterName, sentinels, clientConfig);\n} catch (JedisConnectionException e) {\n  log.error(\"All sentinels down; retrying with backoff\", e);\n  // retry with exponential backoff, then alert / fall back to last-known master address\n}","preventionTips":["Configure at least 3 sentinels across failure domains.","Probe sentinel endpoints with PING during health checks/startup.","Keep sentinel addresses current via DNS/service discovery, not hardcoded IPs.","Open firewall/security-group rules for the sentinel port (26379)."],"tags":["jedis","sentinel","network","redis"],"backgroundTag":"connection-refused","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"}