{"record":{"id":"cdcd465dbc5f2f4e","repo":"apache/hadoop","slug":"unknown-processor-valid-processors-xml-binar","errorCode":null,"errorMessage":"Unknown processor {} (valid processors: xml, binary, stats)","messagePattern":"Unknown processor (.+?) \\(valid processors: xml, binary, stats\\)","errorType":"validation","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/OfflineEditsVisitorFactory.java","lineNumber":69,"sourceCode":"    OfflineEditsVisitor vis;\n    OutputStream fout = Files.newOutputStream(Paths.get(filename));\n    OutputStream out = null;\n    try {\n      if (!printToScreen) {\n        out = fout;\n      }\n      else {\n        OutputStream outs[] = new OutputStream[2];\n        outs[0] = fout;\n        outs[1] = System.out;\n        out = new TeeOutputStream(outs);\n      }\n      if(StringUtils.equalsIgnoreCase(\"xml\", processor)) {\n        vis = new XmlEditsVisitor(out);\n      } else if(StringUtils.equalsIgnoreCase(\"stats\", processor)) {\n        vis = new StatisticsEditsVisitor(out);\n      } else {\n        throw new IOException(\"Unknown processor \" + processor +\n          \" (valid processors: xml, binary, stats)\");\n      }\n      out = fout = null;\n      return vis;\n    } finally {\n      IOUtils.closeStream(fout);\n      IOUtils.closeStream(out);\n    }\n  }\n}\n","sourceCodeStart":51,"sourceCodeEnd":80,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/OfflineEditsVisitorFactory.java#L51-L80","documentation":"The offline edits viewer ('hdfs oev') chooses its output visitor from the -processor option. 'binary' is dispatched early (it writes raw output and takes the filename directly); all other processors open the output stream first and this factory accepts only 'xml' and 'stats' (case-insensitive). Any other value falls through to IOException('Unknown processor ... (valid processors: xml, binary, stats)').","triggerScenarios":"Running 'hdfs oev -i edits -o out.xml -p <value>' where value is not xml/binary/stats — e.g. 'XML ' with a trailing space from shell quoting, 'json', or a typo like 'stat'.","commonSituations":"Scripts parameterizing the processor variable with an empty or misspelled value; users assuming a JSON or text processor exists; whitespace introduced by variable expansion ('$PROC' unset).","solutions":["Use exactly one of xml, binary, or stats as the -p/-processor value (matching is case-insensitive).","Echo the variable before running to catch empty or whitespace-padded values in scripts.","Run 'hdfs oev -h' for the current option set of your Hadoop version."],"exampleFix":"# before\nhdfs oev -i edits_in_progress -o /tmp/edits.xml -p XMLS\n# Unknown processor XMLS (valid processors: xml, binary, stats)\n\n# after\nhdfs oev -i edits_in_progress -o /tmp/edits.xml -p xml","handlingStrategy":"validation","validationCode":"Set<String> VALID = Set.of(\"xml\", \"binary\", \"stats\");\nString processor = opts.valueOf(\"-p\").trim().toLowerCase(Locale.ROOT);\nif (!VALID.contains(processor)) {\n  throw new IllegalArgumentException(\n      \"processor must be one of xml, binary, stats; got '\" + processor + \"'\");\n}\nOfflineEditsViewer.run(args);","typeGuard":null,"tryCatchPattern":"try {\n  OfflineEditsVisitorFactory.getEditsVisitor(outFile, processor, printToScreen);\n} catch (IOException e) {\n  if (e.getMessage().startsWith(\"Unknown processor\")) {\n    throw new IllegalArgumentException(\n        \"Valid oev processors are xml, binary, stats\", e);\n  }\n  throw e;\n}","preventionTips":["Normalize the processor variable (trim + lowercase) before passing it to oev.","Fail scripts early when the processor variable is empty instead of letting '-p' receive garbage."],"tags":["hadoop","hdfs","offline-edits-viewer","cli","arguments"],"backgroundTag":"invalid-cli-option-value","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}