{"record":{"id":"245e68266ce4bec4","repo":"redis/jedis","slug":"status-245e68","errorCode":null,"errorMessage":"${status}","messagePattern":"\\$\\{status\\}","errorType":"exception","errorClass":"JedisException","httpStatus":null,"severity":"error","filePath":"src/main/java/redis/clients/jedis/ReliableTransaction.java","lineNumber":128,"sourceCode":"    String status = connection.executeCommand(commandObjects.watch(keys));\n    inWatch = true;\n    return status;\n  }\n\n  @Override\n  public String unwatch() {\n    connection.sendCommand(UNWATCH);\n    String status = connection.getStatusCodeReply();\n    inWatch = false;\n    return status;\n  }\n\n  @Override\n  protected final <T> Response<T> appendCommand(CommandObject<T> commandObject) {\n    connection.sendCommand(commandObject.getArguments());\n    String status = connection.getStatusCodeReply();\n    if (!QUEUED_STR.equals(status)) {\n      throw new JedisException(status);\n    }\n    Response<T> response = new Response<>(commandObject.getBuilder());\n    pipelinedResponses.add(response);\n    return response;\n  }\n\n  @Override\n  public final void close() {\n    try {\n      clear();\n    } finally {\n      if (closeConnection) {\n        connection.close();\n      }\n    }\n  }\n\n  @Deprecated // TODO: private","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/redis/jedis/blob/6dac31d4c224fb3257c216f3985340c6f500cdcb/src/main/java/redis/clients/jedis/ReliableTransaction.java#L110-L146","documentation":"In a MULTI transaction, every queued command must reply +QUEUED. ReliableTransaction.appendCommand checks the status reply and throws JedisException(status) whenever the server returns something other than QUEUED — typically an error such as WRONGTYPE, unknown command, or OOM, reported at queue time rather than at exec() time.","triggerScenarios":"Queuing a command inside MULTI whose arguments the server rejects: wrong key type (WRONGTYPE), command not loaded on the server (unknown command), out-of-memory (OOM), or NOPERM for missing ACL permissions.","commonSituations":"ACL-restricted users lacking rights to a queued command; Redis version older than the command used; OOM when maxmemory is hit; key type changed between planning and queuing.","solutions":["Read the exception message — it is the raw server error (e.g. WRONGTYPE, NOPERM, OOM) — and fix the offending command's arguments/permissions.","Verify the Redis server version supports every command queued in the transaction.","Check the ACL rules for the authenticated user and memory limits before queuing.","Call discard() on failure so the connection does not remain in MULTI state."],"exampleFix":"// before\nTransaction t = jedis.multi();\nt.rpush(\"mystring\", \"v\"); // throws JedisException: WRONGTYPE ...\n\n// after\nif (jedis.type(\"mystring\").equals(\"list\")) {\n  Transaction t = jedis.multi();\n  t.rpush(\"mystring\", \"v\");\n} else {\n  // handle wrong key type before opening the transaction\n}","handlingStrategy":"try-catch","validationCode":"String type = jedis.type(key);\nif (!expectedType.equals(type)) {\n  throw new IllegalStateException(\"Key \" + key + \" is \" + type + \", expected \" + expectedType);\n}","typeGuard":null,"tryCatchPattern":"try {\n  transaction.set(key, value);\n} catch (JedisException e) {\n  transaction.discard();\n  // e.getMessage() holds the server error: WRONGTYPE/NOPERM/OOM/unknown command\n  handleQueueError(e.getMessage());\n}","preventionTips":["Check key types (TYPE) before queuing commands against them.","Verify the ACL user has permission for every command queued.","Confirm server version supports all commands used; watch maxmemory/OOM conditions."],"tags":["transaction","queued","server-error"],"backgroundTag":"invalid-state-transition","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"}