apache/hadoop · error · IOException
Unknown processor {} (valid processors: xml, binary, stats)
Error message
Unknown processor {} (valid processors: xml, binary, stats) What it means
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)').
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/OfflineEditsVisitorFactory.java:69
OfflineEditsVisitor vis;
OutputStream fout = Files.newOutputStream(Paths.get(filename));
OutputStream out = null;
try {
if (!printToScreen) {
out = fout;
}
else {
OutputStream outs[] = new OutputStream[2];
outs[0] = fout;
outs[1] = System.out;
out = new TeeOutputStream(outs);
}
if(StringUtils.equalsIgnoreCase("xml", processor)) {
vis = new XmlEditsVisitor(out);
} else if(StringUtils.equalsIgnoreCase("stats", processor)) {
vis = new StatisticsEditsVisitor(out);
} else {
throw new IOException("Unknown processor " + processor +
" (valid processors: xml, binary, stats)");
}
out = fout = null;
return vis;
} finally {
IOUtils.closeStream(fout);
IOUtils.closeStream(out);
}
}
}
View on GitHub (pinned to 2add963021)
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.
Example fix
# before hdfs oev -i edits_in_progress -o /tmp/edits.xml -p XMLS # Unknown processor XMLS (valid processors: xml, binary, stats) # after hdfs oev -i edits_in_progress -o /tmp/edits.xml -p xml
Defensive patterns
Strategy: validation
Validate before calling
Set<String> VALID = Set.of("xml", "binary", "stats");
String processor = opts.valueOf("-p").trim().toLowerCase(Locale.ROOT);
if (!VALID.contains(processor)) {
throw new IllegalArgumentException(
"processor must be one of xml, binary, stats; got '" + processor + "'");
}
OfflineEditsViewer.run(args); Try / catch
try {
OfflineEditsVisitorFactory.getEditsVisitor(outFile, processor, printToScreen);
} catch (IOException e) {
if (e.getMessage().startsWith("Unknown processor")) {
throw new IllegalArgumentException(
"Valid oev processors are xml, binary, stats", e);
}
throw e;
} Prevention
- 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.
When it happens
Trigger: 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'.
Common situations: 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).
Related errors
- Invalid or extra Arguments: {}
- Did not expect argument: {}
- usage: -confKey [key]
- invalid args: {}
- Illegal option {}
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/cdcd465dbc5f2f4e.
Report an issue: GitHub.