apache/hadoop · error · IOException

<fileDiffEntry> contained no <inodeid> entry.

Error message

<fileDiffEntry> contained no <inodeid> entry.

What it means

A <fileDiffEntry> header in <SnapshotDiffSection> is missing its inode ID child, which the protobuf DiffEntry requires. Beware the message typo: it prints '<inodeid>' lowercase, but the element actually required is <inodeId> (constant SNAPSHOT_DIFF_SECTION_INODE_ID = "inodeId"), exactly as in <dirDiffEntry>.

Source

Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/OfflineImageReconstructor.java:1540

          throw new IOException("<createdListSize> was " +
              expectedCreatedListSize +", but there were " +
              actualCreatedListSize + " <created> entries.");
        }
        dirDiff.verifyNoRemainingKeys("dirDiff");
      }
      expectTagEnd(SNAPSHOT_DIFF_SECTION_DIR_DIFF_ENTRY);
    }

    private void processFileDiffEntry() throws IOException {
      LOG.debug("Processing fileDiffEntry");
      DiffEntry.Builder headerBld = DiffEntry.newBuilder();
      headerBld.setType(DiffEntry.Type.FILEDIFF);
      Node fileDiffHeader = new Node();
      loadNodeChildren(fileDiffHeader, "fileDiffEntry fields", "fileDiff");
      Long inodeId = fileDiffHeader.removeChildLong(
          SNAPSHOT_DIFF_SECTION_INODE_ID);
      if (inodeId == null) {
        throw new IOException("<fileDiffEntry> contained no <inodeid> entry.");
      }
      headerBld.setInodeId(inodeId);
      Integer expectedDiffs = fileDiffHeader.removeChildInt(
          SNAPSHOT_DIFF_SECTION_COUNT);
      if (expectedDiffs == null) {
        throw new IOException("<fileDiffEntry> contained no <count> entry.");
      }
      headerBld.setNumOfDiff(expectedDiffs);
      fileDiffHeader.verifyNoRemainingKeys("fileDiffEntry");
      headerBld.build().writeDelimitedTo(out);
      for (int actualDiffs = 0; actualDiffs < expectedDiffs; actualDiffs++) {
        try {
          expectTag(SNAPSHOT_DIFF_SECTION_FILE_DIFF, false);
        } catch (IOException e) {
          throw new IOException("Only read " + (actualDiffs + 1) +
              " diffs out of " + expectedDiffs, e);
        }
        Node fileDiff = new Node();

View on GitHub (pinned to 2add963021)

Solutions

  1. Add <inodeId>NUMBER</inodeId> as the first header child of the <fileDiffEntry> (the error text 'inodeid' is a typo - the tag is 'inodeId')
  2. Make sure it appears before the first <fileDiff> element
  3. Check exact spelling and case
  4. Regenerate the XML with a matching-version oiv

Example fix

<!-- before -->
<fileDiffEntry><count>1</count><fileDiff>...</fileDiff></fileDiffEntry>
<!-- after -->
<fileDiffEntry><inodeId>16390</inodeId><count>1</count><fileDiff>...</fileDiff></fileDiffEntry>
Defensive patterns

Strategy: validation

Validate before calling

# python: every fileDiffEntry header must contain <inodeId> (capital I and D)
import xml.etree.ElementTree as ET

def file_entries_have_inodeid(path):
    for ev, el in ET.iterparse(path, events=('end',)):
        if el.tag == 'fileDiffEntry' and el.find('inodeId') is None:
            return False
    return True

Try / catch

// oiv failure '<fileDiffEntry> contained no <inodeid>' -> the required tag
// is actually <inodeId>; add it, delete partial output, re-run

Prevention

When it happens

Trigger: A <fileDiffEntry> whose <inodeId> was omitted or renamed, or placed after the first <fileDiff> so it lands in diff content instead of the header; also copy-paste from dir entries where the field got stripped.

Common situations: Hand-built file-diff entries; scripts converting dir diffs to file diffs and dropping the ID; field-name drift across writer versions.

Related errors


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/b98a3deb40927e1b. Report an issue: GitHub.