apache/seatunnel · error · RedisConnectorException

RedisErrorCode-06

RedisErrorCode-06

Error message

Node not found in cluster: <node>

What it means

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.

Source

Thrown at seatunnel-connectors-v2/connector-redis/src/main/java/org/apache/seatunnel/connectors/seatunnel/redis/config/JedisWrapper.java:148

    @Override
    public void close() {
        jedisCluster.close();
        jedisPoolMap.values().forEach(Jedis::close);
        jedisPoolMap.clear();
    }

    public Jedis getJedis(String node) {
        Jedis jedis = jedisPoolMap.get(node);
        if (jedis != null) {
            return jedis;
        }

        // Lazy initialization
        Map<String, ConnectionPool> clusterNodes = jedisCluster.getClusterNodes();
        ConnectionPool connectionPool = clusterNodes.get(node);
        if (connectionPool == null) {
            throw new RedisConnectorException(
                    RedisErrorCode.REDIS_CONNECTION_ERROR, "Node not found in cluster: " + node);
        }

        return getOrCreateJedis(node, connectionPool);
    }

    private Jedis getOrCreateJedis(String node, ConnectionPool connectionPool) {
        return jedisPoolMap.computeIfAbsent(
                node,
                k -> {
                    try {
                        return new Jedis(connectionPool.getResource());
                    } catch (Exception e) {
                        throw new RedisConnectorException(
                                RedisErrorCode.REDIS_CONNECTION_ERROR,
                                "Redis connection error. node: " + node);
                    }
                });

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Use the exact host:port the cluster advertises — compare with 'redis-cli cluster nodes' output
  2. Recreate the JedisCluster client so its topology snapshot is refreshed after failover/resharding
  3. Normalize the configured node to match cluster advertised addresses (IP vs hostname, port)
  4. Check cluster health; if the node failed over, target the new master for that key range

Example fix

// before: raw lookup throws when node string mismatches cluster topology
ConnectionPool pool = clusterNodes.get(node);
if (pool == null) throw ...;
// after: fall back to case/format-normalized lookup or refresh topology
ConnectionPool pool = clusterNodes.get(node);
if (pool == null) {
    pool = clusterNodes.entrySet().stream()
        .filter(e -> e.getKey().equalsIgnoreCase(node))
        .map(Map.Entry::getValue).findFirst().orElse(null);
}
if (pool == null) throw new RedisConnectorException(RedisErrorCode.REDIS_CONNECTION_ERROR, "Node not found in cluster: " + node);
Defensive patterns

Strategy: validation

Validate before calling

// before calling getJedis(node)
Set<String> known = jedisCluster.getClusterNodes().keySet();
if (!known.contains(node)) { /* refresh topology or correct the node string */ }

Try / catch

try { Jedis j = wrapper.getJedis(node); } catch (RedisConnectorException e) {
  if (e.getMessage().startsWith("Node not found")) { /* rebuild JedisCluster / re-read topology, then retry */ }
}

Prevention

When it happens

Trigger: 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.

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

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 apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/c763bb3e60b362d2. Report an issue: GitHub.