{"record":{"id":"e9ed3809c699786d","repo":"apache/hadoop","slug":"illegal-command","errorCode":null,"errorMessage":"Illegal command: {}","messagePattern":"Illegal command: (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/java/org/apache/hadoop/mapred/nativetask/handlers/NativeCollectorOnlyHandler.java","lineNumber":162,"sourceCode":"    }\n        \n    if (command.equals(GET_OUTPUT_PATH)) {\n      p = output.getOutputFileForWrite(-1);\n    } else if (command.equals(GET_OUTPUT_INDEX_PATH)) {\n      p = output.getOutputIndexFileForWrite(-1);\n    } else if (command.equals(GET_SPILL_PATH)) {\n      p = output.getSpillFileForWrite(spillNumber++, -1);\n      \n    } else if (command.equals(GET_COMBINE_HANDLER)) {\n      if (null == combinerHandler) {\n        return null;\n      }\n      final ReadWriteBuffer result = new ReadWriteBuffer(8);\n      \n      result.writeLong(combinerHandler.getId());\n      return result;\n    } else {\n      throw new IOException(\"Illegal command: \" + command.toString());\n    }\n    if (p != null) {\n      final ReadWriteBuffer result = new ReadWriteBuffer();\n      result.writeString(p.toUri().getPath());\n      return result;\n    } else {\n      throw new IOException(\"MapOutputFile can't allocate spill/output file\");\n    }\n  }\n}\n","sourceCodeStart":144,"sourceCodeEnd":173,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/java/org/apache/hadoop/mapred/nativetask/handlers/NativeCollectorOnlyHandler.java#L144-L173","documentation":"Error \"Illegal command: {}\" thrown in apache/hadoop.","triggerScenarios":"Thrown by NativeCollectorOnlyHandler when the native task side sends a command id the Java handler does not recognize. Indicates a version mismatch between libnativetask native library and the Java nativetask code; rebuild both from the same source tree.","commonSituations":"Version skew between Java nativetask code and the compiled native library; corrupted command stream.","solutions":["Verify the native task protocol: the Java side sent a command id the native handler does not recognize; ensure hadoop-client-nativetask Java and native library versions match.","Rebuild libnativetask.so from the same Hadoop source version as the Java client."],"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"}