{"record":{"id":"9b182b7b4f5bff40","repo":"redis/jedis","slug":"not-supported-in-cluster-mode","errorCode":null,"errorMessage":"Not supported in cluster mode.","messagePattern":"Not supported in cluster mode\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"src/main/java/redis/clients/jedis/ClusterCommandObjects.java","lineNumber":80,"sourceCode":"    byte[] match = params.binaryMatch();\n    if (match == null || !JedisClusterHashTag.isClusterCompliantMatchPattern(match)) {\n      throw new IllegalArgumentException(SCAN_PATTERN_MESSAGE);\n    }\n    return new CommandObject<>(commandArguments(SCAN).add(cursor).addParams(params).addHashSlotKey(match), BuilderFactory.SCAN_BINARY_RESPONSE);\n  }\n\n  @Override\n  public final CommandObject<ScanResult<byte[]>> scan(byte[] cursor, ScanParams params, byte[] type) {\n    byte[] match = params.binaryMatch();\n    if (match == null || !JedisClusterHashTag.isClusterCompliantMatchPattern(match)) {\n      throw new IllegalArgumentException(SCAN_PATTERN_MESSAGE);\n    }\n    return new CommandObject<>(commandArguments(SCAN).add(cursor).addParams(params).addHashSlotKey(match).add(TYPE).add(type), BuilderFactory.SCAN_BINARY_RESPONSE);\n  }\n\n  @Override\n  public final CommandObject<Long> waitReplicas(int replicas, long timeout) {\n    throw new UnsupportedOperationException(CLUSTER_UNSUPPORTED_MESSAGE);\n  }\n\n  @Override\n  public CommandObject<KeyValue<Long, Long>> waitAOF(long numLocal, long numReplicas, long timeout) {\n    throw new UnsupportedOperationException(CLUSTER_UNSUPPORTED_MESSAGE);\n  }\n\n  @Override\n  public CommandObject<String> hotkeysStart(HotkeysParams params) {\n    throw new UnsupportedOperationException(CLUSTER_UNSUPPORTED_MESSAGE);\n  }\n\n  @Override\n  public CommandObject<String> hotkeysStop() {\n    throw new UnsupportedOperationException(CLUSTER_UNSUPPORTED_MESSAGE);\n  }\n\n  @Override","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/redis/jedis/blob/6dac31d4c224fb3257c216f3985340c6f500cdcb/src/main/java/redis/clients/jedis/ClusterCommandObjects.java#L62-L98","documentation":"WAIT replicas is not exposed through the cluster command objects because in Redis Cluster wait semantics are per-connection/per-replica and the unified cluster executor does not support it here. Calling waitReplicas on a cluster client throws UnsupportedOperationException with the generic CLUSTER_UNSUPPORTED_MESSAGE.","triggerScenarios":"Calling `clusterClient.waitReplicas(replicas, timeout)` or including WAIT in a cluster pipeline via ClusterCommandObjects.","commonSituations":"Replication-acknowledgement logic (write durability checks) ported from standalone Jedis to RedisClusterClient.","solutions":["Issue WAIT on a dedicated direct connection to the specific master node holding the key's slot","Obtain a Jedis/connection from the cluster's connection provider for the key's slot and call waitReplicas there","Remove/replace the WAIT call if per-node durability semantics are not required"],"exampleFix":"// before\ncluster.waitReplicas(1, 1000);\n// after\ntry (Jedis node = cluster.getConnectionForKey(slot)) {\n  node.waitReplicas(1, 1000);\n}","handlingStrategy":"fallback","validationCode":"if (client instanceof UnifiedJedis && ((UnifiedJedis) client).isClusterMode()) { /* route WAIT to a direct node connection */ }","typeGuard":"static boolean supportsWait(JedisCommandsLike c) { return !(c instanceof ClusterCommandObjects) && !(c instanceof RedisClusterClient); }","tryCatchPattern":"try { cluster.waitReplicas(1, timeout); } catch (UnsupportedOperationException e) { nodeConn.waitReplicas(1, timeout); }","preventionTips":["Check cluster vs standalone mode before issuing replication-control commands","Keep a direct connection handle to masters for WAIT-style commands","Document that WAIT semantics in cluster are per node/slot"],"tags":["redis-cluster","wait","unsupported-operation","replication"],"backgroundTag":"operation-not-supported","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"}