{"record":{"id":"8d9eebc4641bfe4b","repo":"redis/jedis","slug":"sentinel-is-not-monitoring-master","errorCode":null,"errorMessage":"Sentinel {} is not monitoring master {}.","messagePattern":"Sentinel (.+?) is not monitoring master (.+?)\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/main/java/redis/clients/jedis/providers/SentineledConnectionProvider.java","lineNumber":266,"sourceCode":"    HostAndPort master = null;\n    boolean sentinelAvailable = false;\n\n    LOG.debug(\"Trying to find master from available sentinels...\");\n\n    for (HostAndPort sentinel : sentinels) {\n\n      LOG.debug(\"Connecting to Sentinel {}...\", sentinel);\n\n      try (Jedis jedis = sentinelConnectionFactory.createConnection(sentinel,\n        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(\"Sentinel {} is not monitoring master {}.\", sentinel, masterName);\n          continue;\n        }\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.\");","sourceCodeStart":248,"sourceCodeEnd":284,"githubUrl":"https://github.com/redis/jedis/blob/6dac31d4c224fb3257c216f3985340c6f500cdcb/src/main/java/redis/clients/jedis/providers/SentineledConnectionProvider.java#L248-L284","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Run 'SENTINEL get-master-addr-by-name <masterName>' against each Sentinel to confirm the name exists.","Fix the masterName in the client configuration to match the name used in the Sentinels' sentinel monitor directive.","If the master name is wrong on the Sentinel side, add/correct it: 'SENTINEL monitor <name> <ip> <port> <quorum>'.","Ensure the client's sentinel list actually points at the Sentinels that monitor the intended master set."],"exampleFix":"// before\nJedisSentinelPool pool = new JedisSentinelPool(\"mymater\", sentinels, config); // typo\n// after\nJedisSentinelPool pool = new JedisSentinelPool(\"mymaster\", sentinels, config); // matches 'sentinel monitor mymaster ...'","handlingStrategy":"validation","validationCode":"try (Jedis sentinel = new Jedis(\"sentinel1\", 26379)) {\n  List<String> addr = sentinel.sentinelGetMasterAddrByName(\"mymaster\");\n  if (addr == null || addr.size() != 2) {\n    throw new IllegalStateException(\"Sentinel does not monitor master 'mymaster' - fix masterName or 'SENTINEL monitor' config before building the client\");\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  pool = new JedisSentinelPool(masterName, sentinels, config);\n} catch (JedisException e) {\n  throw new IllegalStateException(\"No Sentinel could resolve master '\" + masterName + \"'; verify master name and Sentinel config\", e);\n}","preventionTips":["Copy the master name exactly from 'SENTINEL master <name>' output — names are case-sensitive strings like 'mymaster'.","Pre-flight check masterName with redis-cli SENTINEL get-master-addr-by-name before deploying.","Point the client at the Sentinel set that actually monitors your master (same cluster/replica set)."],"tags":["redis-sentinel","master-name","configuration","high-availability"],"backgroundTag":"resource-not-found","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"}