{"record":{"id":"5813c03648f59c5d","repo":"apache/hadoop","slug":"message-type-is-expected-to-be-but-got","errorCode":null,"errorMessage":"Message type is expected to be {} but got {}","messagePattern":"Message type is expected to be (.+?) but got (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/oncrpc/RpcMessage.java","lineNumber":65,"sourceCode":"      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 \"\n          + expected + \" but got \" + messageType);\n    }\n  }\n}\n","sourceCodeStart":47,"sourceCodeEnd":70,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/oncrpc/RpcMessage.java#L47-L70","documentation":"Error \"Message type is expected to be {} but got {}\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/oncrpc/RpcMessage.java:65 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Align client and server expectations for the message type; a REPLY was expected but a different type arrived, indicating protocol mismatch or desynchronization.","Check for version mismatches between client and server RPC implementations.","Inspect the network for corrupted or interleaved RPC frames."],"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"}