redis/jedis · critical · JedisConnectionException

All sentinels down, cannot determine where is

Error message

All sentinels down, cannot determine where is <masterName> master is running...

What it means

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.

Solutions

  1. Test reachability: `redis-cli -h <sentinel-host> -p 26379 ping` from the client machine.
  2. Fix network/firewall rules so the client can reach all sentinel ports.
  3. Correct the sentinel host/port list in the pool configuration.
  4. Restart the sentinel processes (`redis-server sentinel.conf --sentinel`) and re-create the pool.

Example fix

// before
Set<String> sentinels = new HashSet<>(Arrays.asList("10.0.0.5:26379")); // unreachable
JedisSentinelPool pool = new JedisSentinelPool("mymaster", sentinels);
// after
Set<String> sentinels = new HashSet<>(Arrays.asList("sentinel-1:26379","sentinel-2:26379","sentinel-3:26379"));
JedisSentinelPool pool = new JedisSentinelPool("mymaster", sentinels); // reachable quorum
Defensive patterns

Strategy: retry

Validate before calling

for (String s : sentinels) {
  String[] hp = s.split(":");
  try (Jedis j = new Jedis(hp[0], Integer.parseInt(hp[1]))) { j.ping(); }
  catch (Exception e) { throw new IllegalStateException("Sentinel unreachable: " + s); }
}

Try / catch

try {
  pool = new JedisSentinelPool(masterName, sentinels);
} catch (JedisConnectionException e) {
  if (e.getMessage().contains("All sentinels down")) {
    // backoff and retry; alert ops if persistent
  } else throw e;
}

Prevention

When it happens

Trigger: Constructor-time initSentinels() loop fails to connect (connection refused/timeout) to every host:port in the sentinels set, leaving sentinelAvailable == false and master == null.

Common situations: 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.

Understand the failure class

Background: ECONNREFUSED and "connection refused" / "could not connect to server" errors: what they mean and how to fix them — this error's family across 44 libraries.

Related errors


AI-assisted analysis of redis/jedis@6dac31d4c2 (2026-09-08). Data as JSON: /api/errors/2f82812f2f5f6e84. Report an issue: GitHub.

Appendix: source

Thrown at src/main/java/redis/clients/jedis/JedisSentinelPool.java:285

        master = toHostAndPort(masterAddr);
        LOG.debug("Found Redis master at {}", master);
        break;
      } catch (JedisException e) {
        // resolves #1036, it should handle JedisException there's another chance
        // of raising JedisDataException
        LOG.warn(
          "Cannot get master address from sentinel running @ {}. Reason: {}. Trying next one.", sentinel, e);
      }
    }

    if (master == null) {
      if (sentinelAvailable) {
        // can connect to sentinel, but master name seems to not monitored
        throw new JedisException("Can connect to sentinel, but " + masterName
            + " seems to be not monitored...");
      } else {
        throw new JedisConnectionException("All sentinels down, cannot determine where is "
            + masterName + " master is running...");
      }
    }

    LOG.info("Redis master running at {}, starting Sentinel listeners...", master);

    for (HostAndPort sentinel : sentinels) {

      MasterListener masterListener = new MasterListener(masterName, sentinel.getHost(), sentinel.getPort());
      // whether MasterListener threads are alive or not, process can be stopped
      masterListener.setDaemon(true);
      masterListeners.add(masterListener);
      masterListener.start();
    }

    return master;
  }

View on GitHub (pinned to 6dac31d4c2)