{"record":{"id":"294e4c73a5dd5cfe","repo":"redis/jedis","slug":"cannot-get-master-address-from-sentinel-running","errorCode":null,"errorMessage":"Cannot get master address from sentinel running @ {}. Reason: {}. Trying next one.","messagePattern":"Cannot get master address from sentinel running @ (.+?)\\. Reason: (.+?)\\. Trying next one\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/main/java/redis/clients/jedis/JedisSentinelPool.java","lineNumber":274,"sourceCode":"      try (Jedis jedis = new Jedis(sentinel, sentinelClientConfig)) {\n\n        List<String> masterAddr = jedis.sentinelGetMasterAddrByName(masterName);\n\n        // connected to sentinel...\n        sentinelAvailable = true;\n\n        if (masterAddr == null || masterAddr.size() != 2) {\n          LOG.warn(\"Can not get master addr, master name: {}. Sentinel: {}\", masterName, sentinel);\n          continue;\n        }\n\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) {","sourceCodeStart":256,"sourceCodeEnd":292,"githubUrl":"https://github.com/redis/jedis/blob/6dac31d4c224fb3257c216f3985340c6f500cdcb/src/main/java/redis/clients/jedis/JedisSentinelPool.java#L256-L292","documentation":"While resolving the master address, each Sentinel is queried in turn. If querying one Sentinel throws a JedisException (connection failure, timeouts, or a JedisDataException — see issue #1036), the pool logs this warning with the Sentinel address and reason, then tries the next Sentinel. Only when all Sentinels fail does initSentinels throw. This is the per-Sentinel retry log for master discovery.","triggerScenarios":"Connecting to or issuing sentinelGetMasterAddrByName on one Sentinel raises JedisException: Sentinel down, wrong address/port, auth required (requirepass on Sentinel), network partition, or Sentinel returns an error response.","commonSituations":"One Sentinel host is down or unreachable from the client; Sentinel requires a password the client config lacks; DNS points at a dead instance; firewall blocks 26379; Sentinel returning -ERR/-NOAUTH data exceptions.","solutions":["Check the 'Reason' in the log: fix connectivity to that Sentinel (host/port/firewall) or supply sentinelClientConfig with the correct password.","Remove permanently dead Sentinels from your sentinel set to reduce discovery latency.","Verify Sentinel auth config: if Sentinels use requirepass/ACL, set the corresponding credentials in the client's sentinel config.","Ensure at least one healthy Sentinel remains; run `redis-cli -p 26379 ping` on each listed Sentinel.","If JedisDataException appears, check Sentinel version compatibility and that the command isn't disabled (renamed commands)."],"exampleFix":"// before\nJedisSentinelPool pool = new JedisSentinelPool(master, sentinels); // Sentinel requires auth\n// after\nJedisClientConfig sentinelCfg = DefaultJedisClientConfig.builder()\n    .password(\"sentinelPass\").build();\nJedisSentinelPool pool = new JedisSentinelPool(master, sentinels, sentinelCfg, masterCfg);","handlingStrategy":"fallback","validationCode":"for (String s : sentinels) {\n  try (Jedis j = new Jedis(host(s), port(s))) {\n    j.ping(); // preflight each sentinel's reachability/auth\n  }\n}","typeGuard":null,"tryCatchPattern":"try { addr = sentinel.sentinelGetMasterAddrByName(masterName); } catch (JedisException e) { log.warn(\"sentinel {} failed: {}, trying next\", s, e); continue; }","preventionTips":["Preflight all Sentinel endpoints (ping + auth) in deployment checks","Configure Sentinel passwords in the client's sentinelClientConfig if required","Provide 3+ Sentinels across failure domains so one bad node doesn't matter","Remove permanently dead Sentinel entries from config"],"tags":["redis","sentinel","network","failover","high-availability"],"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"}