{"record":{"id":"c8c5b37d3f7d2ec9","repo":"apache/hadoop","slug":"unknown-status-status-message-message","errorCode":null,"errorMessage":"Unknown status: ${status}, message: ${message}","messagePattern":"Unknown status: (.+?), message: (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/datatransfer/sasl/DataTransferSaslUtil.java","lineNumber":229,"sourceCode":"    return resolver;\n  }\n\n  private static <T> T readSaslMessage(InputStream in,\n      Function<DataTransferEncryptorMessageProto, ? extends T> handler) throws IOException {\n    DataTransferEncryptorMessageProto proto =\n        DataTransferEncryptorMessageProto.parseFrom(vintPrefixed(in));\n    switch (proto.getStatus()) {\n    case ERROR_UNKNOWN_KEY:\n      throw new InvalidEncryptionKeyException(proto.getMessage());\n    case ERROR:\n      if (proto.hasAccessTokenError() && proto.getAccessTokenError()) {\n        throw new InvalidBlockTokenException(proto.getMessage());\n      }\n      throw new IOException(proto.getMessage());\n    case SUCCESS:\n      return handler.apply(proto);\n    default:\n      throw new IOException(\n          \"Unknown status: \" + proto.getStatus() + \", message: \" + proto.getMessage());\n    }\n  }\n\n  /**\n   * Reads a SASL negotiation message.\n   *\n   * @param in stream to read\n   * @return bytes of SASL negotiation messsage\n   * @throws IOException for any error\n   */\n  public static byte[] readSaslMessage(InputStream in) throws IOException {\n    return readSaslMessage(in, proto -> proto.getPayload().toByteArray());\n  }\n\n  /**\n   * Reads a SASL negotiation message and negotiation cipher options.\n   *","sourceCodeStart":211,"sourceCodeEnd":247,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/datatransfer/sasl/DataTransferSaslUtil.java#L211-L247","documentation":"While reading a DataTransferEncryptorMessageProto (the SASL/encryption negotiation message on a data connection), the response's status enum hits the default branch of the switch - a value outside SUCCESS, ERROR, ERROR_UNKNOWN_KEY. Either the peer runs a different Hadoop version whose proto schema has additional enum values, or the byte stream is corrupted and parsed into a bogus enum number.","triggerScenarios":"DataTransferEncryptor/SaslDataTransferClient reads a vint-prefixed response proto over the data socket and proto.getStatus() is not one of the three statuses known to this client.","commonSituations":"Rolling upgrades with mixed client/server versions; a proxy, LB or middlebox mangling the data stream; truncated or garbage bytes on the connection.","solutions":["Align Hadoop versions between client and DataNodes (upgrade the older side) so both share the same proto schema","Inspect the exception's 'message' field and DataNode logs for the server-side context","Rule out middleboxes/NAT rewriting or terminating the data connection"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (IOException e) {\n  if (e.getMessage() != null && e.getMessage().startsWith(\"Unknown status:\")) {\n    // proto schema skew or corrupted stream: reconnect with a client matching the server version\n    recreateConnectionWithMatchingClient();\n  } else {\n    throw e;\n  }\n}","preventionTips":["Pin client and server Hadoop versions during rolling upgrades","Read the exception's message field for server-side context before assuming corruption","Keep data connections free of proxies/LBs that rewrite bytes"],"tags":["hdfs","protobuf","version-skew","data-transfer-protocol"],"backgroundTag":"protocol-version-mismatch","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}