apache/hadoop · error · IOException
No image processor to read version {} is available.
Error message
No image processor to read version {} is available. What it means
The legacy OfflineImageViewer (`hdfs oiv_legacy`, for pre-protobuf images) reads the layout version int at the head of the file and asks ImageLoader.LoaderFactory for a loader; no registered legacy loader accepted that version. Almost always this means the input is a protobuf fsimage from Hadoop 2.x+ (legacy loaders stop at the pre-PB layout versions), a corrupt file whose leading int is garbage, or not an fsimage at all.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/OfflineImageViewer.java:137
/**
* Process image file.
*/
public void go() throws IOException {
DataInputStream in = null;
PositionTrackingInputStream tracker = null;
ImageLoader fsip = null;
boolean done = false;
try {
tracker = new PositionTrackingInputStream(new BufferedInputStream(
Files.newInputStream(Paths.get(inputFile))));
in = new DataInputStream(tracker);
int imageVersionFile = findImageVersion(in);
fsip = ImageLoader.LoaderFactory.getLoader(imageVersionFile);
if(fsip == null)
throw new IOException("No image processor to read version " +
imageVersionFile + " is available.");
fsip.loadImage(in, processor, skipBlocks);
done = true;
} finally {
if (!done) {
if (tracker != null) {
LOG.error("image loading failed at offset " + tracker.getPos());
} else {
LOG.error("Failed to load image file.");
}
}
IOUtils.cleanupWithLogger(LOG, in, tracker);
}
}
/**
* Check an fsimage datainputstream's version number.
*View on GitHub (pinned to 2add963021)
Solutions
- Use the protobuf-aware tool for 2.x+ images: `hdfs oiv -i <fsimage> -p delimited|XML|FileDistribution|Web`
- Ensure the oiv binary comes from a Hadoop distribution at least as new as the NameNode that wrote the image
- Confirm the input is really an fsimage: name matches fsimage_<txid> and (for PB images) `head -c 8 <file>` prints HDFSIMG1
- For genuinely old images, verify the leading layout-version int falls in the range the legacy loaders support
Example fix
# before: legacy entry point on a protobuf image hdfs oiv_legacy -i fsimage_0000000000000123456 -o /tmp/out.xml # IOException: No image processor to read version -66 is available. # after: PB-aware entry point hdfs oiv -i fsimage_0000000000000123456 -p XML -o /tmp/out.xml
Defensive patterns
Strategy: validation
Validate before calling
// Peek the layout version before handing the file to oiv_legacy
int layoutVersion;
try (DataInputStream in = new DataInputStream(new BufferedInputStream(
Files.newInputStream(Paths.get(file))))) {
layoutVersion = in.readInt(); // legacy images start with the layout version int
}
if (ImageLoader.LoaderFactory.getLoader(layoutVersion) == null) {
throw new IllegalArgumentException(
"layout version " + layoutVersion
+ " not supported by oiv_legacy; use `hdfs oiv` for protobuf images");
} Prevention
- Default to `hdfs oiv`; reserve oiv_legacy for genuinely pre-2.x images
- Keep the oiv binary's Hadoop version at or above the image's producing NameNode
- Pass explicit fsimage_<txid> paths instead of globbing the NameNode directory
When it happens
Trigger: Running `hdfs oiv_legacy -i <file>` on: a protobuf fsimage from a 2.x+ NameNode, a truncated/corrupt file, an edit log, or the fsimage.md5 sidecar file.
Common situations: Old scripts still calling oiv_legacy after a cluster upgrade; a shell glob picking the wrong file from /dfs/name/current; version-mismatched tooling (tool older than the image).
Related errors
- Unrecognized section {}
- Unsupported file version {}
- String table bits ${bits} > ${maskBits}
- Cannot process fslayout version {imageVersion}
- Layout version mismatch. This oiv tool handles layout versi
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/f41752350810a313.
Report an issue: GitHub.