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
- 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
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
- 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
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
- RedisErrorCode-04
- Failed to get info from node: {}
- CLUSTER_LIST_GET_FAILED
- RedisErrorCode-03
- nodes[%d]: must be in 'host:port' format, got: %s
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/c763bb3e60b362d2.
Report an issue: GitHub.