redis/jedis · warning

Sentinel is not monitoring master .

Error message

Sentinel {} is not monitoring master {}.

What it means

During SentineledConnectionProvider.initSentinels(), the client asks a reachable Sentinel for the address of the configured master via sentinelGetMasterAddrByName. When the Sentinel replies that it does not know this master (null or malformed answer), the provider logs this warning and moves on to the next Sentinel. It means the master name given to the client does not match any master this Sentinel is monitoring.

Solutions

  1. Run 'SENTINEL get-master-addr-by-name <masterName>' against each Sentinel to confirm the name exists.
  2. Fix the masterName in the client configuration to match the name used in the Sentinels' sentinel monitor directive.
  3. If the master name is wrong on the Sentinel side, add/correct it: 'SENTINEL monitor <name> <ip> <port> <quorum>'.
  4. Ensure the client's sentinel list actually points at the Sentinels that monitor the intended master set.

Example fix

// before
JedisSentinelPool pool = new JedisSentinelPool("mymater", sentinels, config); // typo
// after
JedisSentinelPool pool = new JedisSentinelPool("mymaster", sentinels, config); // matches 'sentinel monitor mymaster ...'
Defensive patterns

Strategy: validation

Validate before calling

try (Jedis sentinel = new Jedis("sentinel1", 26379)) {
  List<String> addr = sentinel.sentinelGetMasterAddrByName("mymaster");
  if (addr == null || addr.size() != 2) {
    throw new IllegalStateException("Sentinel does not monitor master 'mymaster' - fix masterName or 'SENTINEL monitor' config before building the client");
  }
}

Try / catch

try {
  pool = new JedisSentinelPool(masterName, sentinels, config);
} catch (JedisException e) {
  throw new IllegalStateException("No Sentinel could resolve master '" + masterName + "'; verify master name and Sentinel config", e);
}

Prevention

When it happens

Trigger: Constructing a JedisSentinelPool / RedisSentinelClient with a masterName that no Sentinel in the configured list actually monitors; Sentinel answers with null or a list whose size != 2 for sentinelGetMasterAddrByName(masterName).

Common situations: Typo in the master name (e.g. 'mymaster' vs actual name from sentinel master output); Sentinel was never configured with 'sentinel monitor <name> ...'; Sentinel monitoring a different replica set than the app expects; master was removed with SENTINEL REMOVE.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at src/main/java/redis/clients/jedis/providers/SentineledConnectionProvider.java:266

    HostAndPort master = null;
    boolean sentinelAvailable = false;

    LOG.debug("Trying to find master from available sentinels...");

    for (HostAndPort sentinel : sentinels) {

      LOG.debug("Connecting to Sentinel {}...", sentinel);

      try (Jedis jedis = sentinelConnectionFactory.createConnection(sentinel,
        sentinelClientConfig)) {

        List<String> masterAddr = jedis.sentinelGetMasterAddrByName(masterName);

        // connected to sentinel...
        sentinelAvailable = true;

        if (masterAddr == null || masterAddr.size() != 2) {
          LOG.warn("Sentinel {} is not monitoring master {}.", sentinel, masterName);
          continue;
        }

        master = toHostAndPort(masterAddr);
        LOG.debug("Redis master reported at {}.", master);
        break;
      } catch (JedisException e) {
        // resolves #1036, it should handle JedisException there's another chance
        // of raising JedisDataException
        LOG.warn("Could not get master address from {}.", 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.");

View on GitHub (pinned to 6dac31d4c2)