apache/hadoop · error · IOException

Unknown FSImage section {}. Valid section names are [{}]

Error message

Unknown FSImage section {}.  Valid section names are [{}]

What it means

After a section name passed the 'known and not-yet-processed' check, the lookup of its SectionProcessor returned null. Because the unprocessed set is built from the very same map the processor comes from, this branch cannot be reached by any input file — it is a defensive guard against the section-registration map itself becoming inconsistent (e.g. in a patched or forked build).

Source

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

          throw new IOException("FSImage XML ended prematurely, without " +
              "including section(s) " + StringUtils.join(", ",
              unprocessedSections));
        }
        throw new IOException("Got unexpected tag end event for " +
            ev.asEndElement().getName().getLocalPart() + " while looking " +
            "for section header tag.");
      } else if (ev.getEventType() != XMLStreamConstants.START_ELEMENT) {
        throw new IOException("Expected section header START_ELEMENT; " +
            "got event of type " + ev.getEventType());
      }
      String sectionName = ev.asStartElement().getName().getLocalPart();
      if (!unprocessedSections.contains(sectionName)) {
        throw new IOException("Unknown or duplicate section found for " +
            sectionName);
      }
      SectionProcessor sectionProcessor = sections.get(sectionName);
      if (sectionProcessor == null) {
        throw new IOException("Unknown FSImage section " + sectionName +
            ".  Valid section names are [" +
            StringUtils.join(", ", sections.keySet()) + "]");
      }
      unprocessedSections.remove(sectionName);
      sectionProcessor.process();
    }

    // Write the StringTable section to disk.
    // This has to be done after the other sections, since some of them
    // add entries to the string table.
    writeStringTableSection();

    // Write the FileSummary section to disk.
    // This section is always last.
    long prevOffset = out.getCount();
    FileSummary fileSummary = fileSummaryBld.build();
    if (LOG.isDebugEnabled()) {
      LOG.debug("Writing FileSummary: {" +

View on GitHub (pinned to 2add963021)

Solutions

  1. Diff your build against upstream OfflineImageReconstructor — this error means local modifications broke the section map
  2. If it reproduces on an unmodified release, open a HADOOP JIRA with the section name and Hadoop version
Defensive patterns

Strategy: try-catch

Try / catch

try {
  // ReverseXML invocation
} catch (IOException e) {
  // unreachable on stock builds: section map inconsistency, not an input problem
  LOG.error("oiv internal section-map inconsistency: {}", e.getMessage());
  throw e;
}

Prevention

When it happens

Trigger: Not triggerable through input; it would require the static sections map in OfflineImageReconstructor to hold a null processor, which stock Hadoop never constructs.

Common situations: Custom Hadoop forks or local patches that modify section registration inside OfflineImageReconstructor.

Related errors


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