apache/hadoop · error · IOException
Incompatible event log version: ${version}
Error message
Incompatible event log version: ${version} What it means
MapReduce job history files (.jhist) begin with a version line written by EventWriter: "Avro-Json" or "Avro-Binary". EventReader accepts exactly those two tags and throws IOException("Incompatible event log version: v") for any other first line, meaning the stream is not a job history in a known format.
Source
Thrown at hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/jobhistory/EventReader.java:82
*/
@SuppressWarnings("deprecation")
public EventReader(DataInputStream in) throws IOException {
this.in = in;
this.version = in.readLine();
Schema myschema = new SpecificData(Event.class.getClassLoader()).getSchema(Event.class);
Schema.Parser parser = new Schema.Parser();
String eventschema = in.readLine();
if (null != eventschema) {
try {
this.schema = parser.parse(eventschema);
this.reader = new SpecificDatumReader(schema, myschema);
if (EventWriter.VERSION.equals(version)) {
this.decoder = DecoderFactory.get().jsonDecoder(schema, in);
} else if (EventWriter.VERSION_BINARY.equals(version)) {
this.decoder = DecoderFactory.get().binaryDecoder(in, null);
} else {
throw new IOException("Incompatible event log version: " + version);
}
} catch (AvroRuntimeException e) {
throw new IOException(e);
}
} else {
throw new IOException("Event schema string not parsed since its null");
}
}
/**
* Get the next event from the stream
* @return the next event
* @throws IOException
*/
@SuppressWarnings("unchecked")
public HistoryEvent getNextEvent() throws IOException {
Event wrapper;
try {View on GitHub (pinned to 2add963021)
Solutions
- Point history tooling at real .jhist files (done/ or intermediatedone/ history directories: job_*.jhist).
- Verify the header before parsing: read the first line and check it is Avro-Json or Avro-Binary.
- If the file was written by a different Hadoop line, read it with a Hadoop build matching the writer.
- Discard files with unrecognized headers when scanning directories instead of failing the scan.
Example fix
# before: wrong file fed to history tooling hadoop job -history /user/me/Logs/application_1690000000000_0001/job_1690000000000_0001-1690000000000-user-word+count-1-0-conf.xml # after: real history file (check header first) hdfs dfs -cat <path>/job_...jhist | head -1 # must print Avro-Json (or Avro-Binary) hadoop job -history <path>/job_...jhist
Defensive patterns
Strategy: try-catch
Validate before calling
// peek the header before building an EventReader
try (FSDataInputStream in = fs.open(path)) {
String version = in.readLine();
if (!("Avro-Json".equals(version) || "Avro-Binary".equals(version))) {
// not a readable jhist - skip it
}
} Try / catch
catch (IOException e) around new EventReader(in): on "Incompatible event log version" close the stream, skip the file in directory scans, and report the file plus its first line for diagnosis.
Prevention
- Consume only job_*.jhist files from the done history directories.
- Validate the first line is Avro-Json/Avro-Binary before parsing.
- Keep reader and writer Hadoop versions aligned when migrating history across clusters.
When it happens
Trigger: Constructing new EventReader(inputStream) on a file whose first line is neither "Avro-Json" nor "Avro-Binary" - a non-history file (job.xml, logs, configs) passed to history parsing, a history written by an incompatible/renamed format, or a file whose first line was corrupted.
Common situations: Running 'mapreduce job -history' or HistoryViewer/JobHistoryParser against the wrong file (e.g. from the wrong directory or a job conf instead of .jhist); tooling that globs a directory and feeds every file to EventReader; cross-version history migration.
Related errors
- Counters version mismatch, expected ${groupFactory.version()
- Event schema string not parsed since its null
- Unknown mode: ${mode}
- Unable to initialize History Viewer
- Failure parsing JSON document: ${je.getMessage()}
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/f5639200a2f605b3.
Report an issue: GitHub.