{"record":{"id":"e9480bfb8bd3d5fb","repo":"redis/jedis","slug":"unknown-reply","errorCode":null,"errorMessage":"Unknown reply: ","messagePattern":"Unknown reply: ","errorType":"exception","errorClass":"JedisConnectionException","httpStatus":null,"severity":"critical","filePath":"src/main/java/redis/clients/jedis/Protocol.java","lineNumber":175,"sourceCode":"          return processMultiBulkReply(is);\n        case GREATER_THAN_BYTE:\n          // Process push message through the consumer chain\n          PushMessage message = processPush(is, pushConsumer);\n          if (message != null) {\n            // Message not consumed by PushConsumers - propagate to application\n            // This preserves backward compatibility by allowing applications to handle\n            // push messages that aren't consumed by internal consumers\n            return message.getContent();\n          } else {\n            // Message was consumed by PushConsumers - continue reading next\n            break;\n          }\n        case MINUS_BYTE:\n          processError(is);\n          return null;\n        // TODO: Blob error '!'\n        default:\n          throw new JedisConnectionException(\"Unknown reply: \" + (char) b);\n      }\n    } while (true);\n\n  }\n\n  private static byte[] processBulkReply(final RedisInputStream is) {\n    return processBulkReply(is, 0);\n  }\n\n  /**\n   * Process a bulk reply, optionally skipping a prefix.\n   * @param is the input stream\n   * @param skipBytes number of bytes to skip at the beginning (used for verbatim strings)\n   * @return the bulk reply data (excluding skipped bytes), or null if length is -1\n   */\n  private static byte[] processBulkReply(final RedisInputStream is, final int skipBytes) {\n    final int len = is.readIntCrLf();\n    if (len == -1) {","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/redis/jedis/blob/6dac31d4c224fb3257c216f3985340c6f500cdcb/src/main/java/redis/clients/jedis/Protocol.java#L157-L193","documentation":"Protocol.process() reads the first byte of a Redis reply and dispatches on the RESP type. If the byte is not one of the known reply markers (+, -, :, $, *, _, #, etc.), it throws JedisConnectionException \"Unknown reply: X\", meaning the bytes on the wire are not a valid RESP reply.","triggerScenarios":"Deserializing a reply whose leading byte is unrecognized: responses to unknown protocol input, corrupted stream desynchronization (e.g. reading a reply mid-stream), or an unexpected char such as 'C'/'O' from a non-Redis or proxy endpoint.","commonSituations":"Pointing the client at something that is not a Redis server, a proxy (HAProxy/Caddy) emitting plain text, RESP3/push-message desync, or custom scripts intercepting traffic.","solutions":["Verify the host/port points to a real Redis server (run redis-cli -h host -p port PING).","Reset/recreate the connection if a desync occurred; never share a Connection across threads.","Check for middleboxes/proxies or TLS misconfiguration returning HTML or plain text.","Upgrade Jedis — new Redis reply types can be unknown to older client versions."],"exampleFix":"// before\nJedis jedis = new Jedis(\"myapp.internal\", 443); // plain-text proxy replies -> Unknown reply\n\n// after\nJedis jedis = new Jedis(\"redis.internal\", 6379); // correct Redis host/port, or use ssl=true for TLS endpoints","handlingStrategy":"try-catch","validationCode":"// before connecting, sanity-check the endpoint answers like Redis\n// e.g. run: redis-cli -h host -p port PING  -> expect PONG","typeGuard":null,"tryCatchPattern":"try {\n  return jedis.get(key);\n} catch (JedisConnectionException e) {\n  if (e.getMessage() != null && e.getMessage().startsWith(\"Unknown reply\")) {\n    // stream desync or non-Redis endpoint: discard connection, verify endpoint, reconnect\n    jedis.close();\n  }\n  throw e;\n}","preventionTips":["Never share a Jedis/Connection object across threads.","Confirm endpoints with redis-cli PING before wiring them into apps.","Check proxies/TLS termination aren't injecting plain-text responses.","Keep Jedis updated for newly introduced reply types."],"tags":["protocol","connection","redis-stream-corruption","resp"],"backgroundTag":"invalid-json-response","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"}