{"record":{"id":"0d0b93850ee804d1","repo":"apache/hadoop","slug":"unknown-fsimage-section-valid-section-names-a","errorCode":null,"errorMessage":"Unknown FSImage section {}.  Valid section names are [{}]","messagePattern":"Unknown FSImage section (.+?)\\.  Valid section names are \\[(.+?)\\]","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/OfflineImageReconstructor.java","lineNumber":1789,"sourceCode":"          throw new IOException(\"FSImage XML ended prematurely, without \" +\n              \"including section(s) \" + StringUtils.join(\", \",\n              unprocessedSections));\n        }\n        throw new IOException(\"Got unexpected tag end event for \" +\n            ev.asEndElement().getName().getLocalPart() + \" while looking \" +\n            \"for section header tag.\");\n      } else if (ev.getEventType() != XMLStreamConstants.START_ELEMENT) {\n        throw new IOException(\"Expected section header START_ELEMENT; \" +\n            \"got event of type \" + ev.getEventType());\n      }\n      String sectionName = ev.asStartElement().getName().getLocalPart();\n      if (!unprocessedSections.contains(sectionName)) {\n        throw new IOException(\"Unknown or duplicate section found for \" +\n            sectionName);\n      }\n      SectionProcessor sectionProcessor = sections.get(sectionName);\n      if (sectionProcessor == null) {\n        throw new IOException(\"Unknown FSImage section \" + sectionName +\n            \".  Valid section names are [\" +\n            StringUtils.join(\", \", sections.keySet()) + \"]\");\n      }\n      unprocessedSections.remove(sectionName);\n      sectionProcessor.process();\n    }\n\n    // Write the StringTable section to disk.\n    // This has to be done after the other sections, since some of them\n    // add entries to the string table.\n    writeStringTableSection();\n\n    // Write the FileSummary section to disk.\n    // This section is always last.\n    long prevOffset = out.getCount();\n    FileSummary fileSummary = fileSummaryBld.build();\n    if (LOG.isDebugEnabled()) {\n      LOG.debug(\"Writing FileSummary: {\" +","sourceCodeStart":1771,"sourceCodeEnd":1807,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/OfflineImageReconstructor.java#L1771-L1807","documentation":"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).","triggerScenarios":"Not triggerable through input; it would require the static sections map in OfflineImageReconstructor to hold a null processor, which stock Hadoop never constructs.","commonSituations":"Custom Hadoop forks or local patches that modify section registration inside OfflineImageReconstructor.","solutions":["Diff your build against upstream OfflineImageReconstructor — this error means local modifications broke the section map","If it reproduces on an unmodified release, open a HADOOP JIRA with the section name and Hadoop version"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  // ReverseXML invocation\n} catch (IOException e) {\n  // unreachable on stock builds: section map inconsistency, not an input problem\n  LOG.error(\"oiv internal section-map inconsistency: {}\", e.getMessage());\n  throw e;\n}","preventionTips":["Run stock Hadoop builds for oiv; do not patch the sections map in OfflineImageReconstructor","If a fork is unavoidable, add a unit test asserting every registered section has a non-null processor"],"tags":["hdfs","offline-image-viewer","internal-invariant"],"backgroundTag":"internal-invariant-violation","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}