{"record":{"id":"49726ee12107f083","repo":"apache/hadoop","slug":"invalid-message-type","errorCode":null,"errorMessage":"Invalid message type {}","messagePattern":"Invalid message type (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/oncrpc/RpcMessage.java","lineNumber":47,"sourceCode":"\n    public int getValue() {\n      return ordinal();\n    }\n\n    public static Type fromValue(int value) {\n      if (value < 0 || value >= values().length) {\n        return null;\n      }\n      return values()[value];\n    }\n  }\n\n  protected final int xid;\n  protected final Type messageType;\n\n  RpcMessage(int xid, Type messageType) {\n    if (messageType != Type.RPC_CALL && messageType != Type.RPC_REPLY) {\n      throw new IllegalArgumentException(\"Invalid message type \" + messageType);\n    }\n    this.xid = xid;\n    this.messageType = messageType;\n  }\n\n  public abstract XDR write(XDR xdr);\n\n  public int getXid() {\n    return xid;\n  }\n\n  public Type getMessageType() {\n    return messageType;\n  }\n\n  protected void validateMessageType(Type expected) {\n    if (expected != messageType) {\n      throw new IllegalArgumentException(\"Message type is expected to be \"","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/oncrpc/RpcMessage.java#L29-L65","documentation":"Error \"Invalid message type {}\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/oncrpc/RpcMessage.java:47 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the RPC message type field is a valid value (CALL or REPLY) per the ONC RPC specification; corrupted or foreign traffic on the port can produce invalid types.","Check that no non-RPC service is sending data to this port.","Capture network traffic to identify the sender of the malformed message."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}