{"record":{"id":"c763bb3e60b362d2","repo":"apache/seatunnel","slug":"rediserrorcode-06","errorCode":"RedisErrorCode-06","errorMessage":"Node not found in cluster: <node>","messagePattern":"Node not found in cluster: <node>","errorType":"error_code","errorClass":"RedisConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-redis/src/main/java/org/apache/seatunnel/connectors/seatunnel/redis/config/JedisWrapper.java","lineNumber":148,"sourceCode":"\n    @Override\n    public void close() {\n        jedisCluster.close();\n        jedisPoolMap.values().forEach(Jedis::close);\n        jedisPoolMap.clear();\n    }\n\n    public Jedis getJedis(String node) {\n        Jedis jedis = jedisPoolMap.get(node);\n        if (jedis != null) {\n            return jedis;\n        }\n\n        // Lazy initialization\n        Map<String, ConnectionPool> clusterNodes = jedisCluster.getClusterNodes();\n        ConnectionPool connectionPool = clusterNodes.get(node);\n        if (connectionPool == null) {\n            throw new RedisConnectorException(\n                    RedisErrorCode.REDIS_CONNECTION_ERROR, \"Node not found in cluster: \" + node);\n        }\n\n        return getOrCreateJedis(node, connectionPool);\n    }\n\n    private Jedis getOrCreateJedis(String node, ConnectionPool connectionPool) {\n        return jedisPoolMap.computeIfAbsent(\n                node,\n                k -> {\n                    try {\n                        return new Jedis(connectionPool.getResource());\n                    } catch (Exception e) {\n                        throw new RedisConnectorException(\n                                RedisErrorCode.REDIS_CONNECTION_ERROR,\n                                \"Redis connection error. node: \" + node);\n                    }\n                });","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-redis/src/main/java/org/apache/seatunnel/connectors/seatunnel/redis/config/JedisWrapper.java#L130-L166","documentation":"Thrown by JedisWrapper.getJedis() during lazy per-node Jedis initialization: the requested node string is looked up in jedisCluster.getClusterNodes(), and if absent, a RedisConnectorException (REDIS_CONNECTION_ERROR) 'Node not found in cluster: <node>' is thrown.","triggerScenarios":"getJedis(node) called with a node identifier that is not a key of the cluster node map — typically a host:port that differs from how JedisCluster registered the node, or a node that has left the cluster.","commonSituations":"Redis cluster resharded/failover moved master slots so the cached node name no longer exists; config specifies IP while the cluster advertises a hostname (or vice versa); typo in the node address; node decommissioned.","solutions":["Use the exact host:port the cluster advertises — compare with 'redis-cli cluster nodes' output","Recreate the JedisCluster client so its topology snapshot is refreshed after failover/resharding","Normalize the configured node to match cluster advertised addresses (IP vs hostname, port)","Check cluster health; if the node failed over, target the new master for that key range"],"exampleFix":"// before: raw lookup throws when node string mismatches cluster topology\nConnectionPool pool = clusterNodes.get(node);\nif (pool == null) throw ...;\n// after: fall back to case/format-normalized lookup or refresh topology\nConnectionPool pool = clusterNodes.get(node);\nif (pool == null) {\n    pool = clusterNodes.entrySet().stream()\n        .filter(e -> e.getKey().equalsIgnoreCase(node))\n        .map(Map.Entry::getValue).findFirst().orElse(null);\n}\nif (pool == null) throw new RedisConnectorException(RedisErrorCode.REDIS_CONNECTION_ERROR, \"Node not found in cluster: \" + node);","handlingStrategy":"validation","validationCode":"// before calling getJedis(node)\nSet<String> known = jedisCluster.getClusterNodes().keySet();\nif (!known.contains(node)) { /* refresh topology or correct the node string */ }","typeGuard":null,"tryCatchPattern":"try { Jedis j = wrapper.getJedis(node); } catch (RedisConnectorException e) {\n  if (e.getMessage().startsWith(\"Node not found\")) { /* rebuild JedisCluster / re-read topology, then retry */ }\n}","preventionTips":["Use the exact host:port strings shown by 'redis-cli cluster nodes'","Rebuild clients after reshard/failover events","Keep node naming consistent (IP vs hostname) with the cluster's announced addresses","Avoid hardcoding node addresses in long-lived jobs"],"tags":["redis","cluster","node-not-found","topology"],"backgroundTag":"resource-not-found","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}