{"record":{"id":"2f82812f2f5f6e84","repo":"redis/jedis","slug":"all-sentinels-down-cannot-determine-where-is-mas","errorCode":null,"errorMessage":"All sentinels down, cannot determine where is <masterName> master is running...","messagePattern":"All sentinels down, cannot determine where is <masterName> master is running\\.\\.\\.","errorType":"exception","errorClass":"JedisConnectionException","httpStatus":null,"severity":"critical","filePath":"src/main/java/redis/clients/jedis/JedisSentinelPool.java","lineNumber":285,"sourceCode":"\n        master = toHostAndPort(masterAddr);\n        LOG.debug(\"Found Redis master 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(\n          \"Cannot get master address from sentinel running @ {}. Reason: {}. Trying next one.\", 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(\"Can connect to sentinel, but \" + masterName\n            + \" seems to be not monitored...\");\n      } else {\n        throw new JedisConnectionException(\"All sentinels down, cannot determine where is \"\n            + masterName + \" master is running...\");\n      }\n    }\n\n    LOG.info(\"Redis master running at {}, starting Sentinel listeners...\", master);\n\n    for (HostAndPort sentinel : sentinels) {\n\n      MasterListener masterListener = new MasterListener(masterName, sentinel.getHost(), sentinel.getPort());\n      // whether MasterListener threads are alive or not, process can be stopped\n      masterListener.setDaemon(true);\n      masterListeners.add(masterListener);\n      masterListener.start();\n    }\n\n    return master;\n  }\n","sourceCodeStart":267,"sourceCodeEnd":303,"githubUrl":"https://github.com/redis/jedis/blob/6dac31d4c224fb3257c216f3985340c6f500cdcb/src/main/java/redis/clients/jedis/JedisSentinelPool.java#L267-L303","documentation":"JedisSentinelPool.initSentinels() throws JedisConnectionException(\"All sentinels down, cannot determine where is <masterName> master is running...\") when none of the configured sentinels could be reached, so the pool cannot discover the master address at all. This is a connectivity failure to the sentinel quorum, not a missing master name.","triggerScenarios":"Constructor-time initSentinels() loop fails to connect (connection refused/timeout) to every host:port in the sentinels set, leaving sentinelAvailable == false and master == null.","commonSituations":"Firewall or security-group blocking sentinel port 26379; sentinels running in another Docker network/namespace; wrong sentinel IPs; all sentinel processes actually down; DNS name not resolving.","solutions":["Test reachability: `redis-cli -h <sentinel-host> -p 26379 ping` from the client machine.","Fix network/firewall rules so the client can reach all sentinel ports.","Correct the sentinel host/port list in the pool configuration.","Restart the sentinel processes (`redis-server sentinel.conf --sentinel`) and re-create the pool."],"exampleFix":"// before\nSet<String> sentinels = new HashSet<>(Arrays.asList(\"10.0.0.5:26379\")); // unreachable\nJedisSentinelPool pool = new JedisSentinelPool(\"mymaster\", sentinels);\n// after\nSet<String> sentinels = new HashSet<>(Arrays.asList(\"sentinel-1:26379\",\"sentinel-2:26379\",\"sentinel-3:26379\"));\nJedisSentinelPool pool = new JedisSentinelPool(\"mymaster\", sentinels); // reachable quorum","handlingStrategy":"retry","validationCode":"for (String s : sentinels) {\n  String[] hp = s.split(\":\");\n  try (Jedis j = new Jedis(hp[0], Integer.parseInt(hp[1]))) { j.ping(); }\n  catch (Exception e) { throw new IllegalStateException(\"Sentinel unreachable: \" + s); }\n}","typeGuard":null,"tryCatchPattern":"try {\n  pool = new JedisSentinelPool(masterName, sentinels);\n} catch (JedisConnectionException e) {\n  if (e.getMessage().contains(\"All sentinels down\")) {\n    // backoff and retry; alert ops if persistent\n  } else throw e;\n}","preventionTips":["Health-check all sentinel endpoints at application startup.","Open firewall/security-group rules for sentinel ports from client hosts.","Use DNS names resolvable in every environment (avoid hardcoded IPs).","Deploy at least 3 sentinels and monitor their availability."],"tags":["sentinel","network","connectivity"],"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"}