{"record":{"id":"d2dd5466b2417f2d","repo":"apache/hadoop","slug":"unrecognized-section-d2dd54","errorCode":null,"errorMessage":"Unrecognized section {}","messagePattern":"Unrecognized section (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/PBImageTextWriter.java","lineNumber":633,"sourceCode":"              if (n1 == null) {\n                return n2 == null ? 0 : -1;\n              } else if (n2 == null) {\n                return -1;\n              } else {\n                return n1.ordinal() - n2.ordinal();\n              }\n            }\n          });\n\n      ImmutableList<Long> refIdList = null;\n      for (FileSummary.Section section : sections) {\n        fin.getChannel().position(section.getOffset());\n        is = FSImageUtil.wrapInputStreamForCompression(conf,\n            summary.getCodec(), new BufferedInputStream(new LimitInputStream(\n                fin, section.getLength())));\n        SectionName sectionName = SectionName.fromString(section.getName());\n        if (sectionName == null) {\n          throw new IOException(\"Unrecognized section \" + section.getName());\n        }\n        switch (sectionName) {\n        case STRING_TABLE:\n          LOG.info(\"Loading string table\");\n          stringTable = FSImageLoader.loadStringTable(is);\n          break;\n        case INODE_REFERENCE:\n          // Load INodeReference so that all INodes can be processed.\n          // Snapshots are not handled and will just be ignored for now.\n          LOG.info(\"Loading inode references\");\n          refIdList = FSImageLoader.loadINodeReferenceSection(is);\n          break;\n        default:\n          break;\n        }\n      }\n\n      loadDirectories(fin, sections, summary, conf);","sourceCodeStart":615,"sourceCodeEnd":651,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/PBImageTextWriter.java#L615-L651","documentation":"The fsimage trailer (FileSummary protobuf) lists every section the image contains, and SectionName.fromString() maps each name to a known type. A null mapping means the image contains a section type this oiv build predates; the text writer aborts instead of silently omitting that section's data.","triggerScenarios":"Reading a fsimage written by a newer Hadoop release that introduced a new section type (its name appears in the exception) with an older `hdfs oiv` binary; the section name in the message identifies exactly which section the tool does not know.","commonSituations":"oiv taken from an old tarball or cluster install and pointed at a newer cluster's fsimage; mixed-version tooling right after a cluster upgrade.","solutions":["Run oiv from a distribution at least as new as the NameNode that wrote the image (compare `hdfs version` with the image's layoutVersion)","Copy the fsimage to a host with the correct-version Hadoop install and run oiv there","There is no skip flag for unknown sections — upgrading the tooling is the only supported path"],"exampleFix":"# before: old tool, new image\n/opt/hadoop-2.8/bin/hdfs oiv -p delimited -i fsimage_new -o out.csv\n# IOException: Unrecognized section ...\n\n# after: matching (or newer) tool\n/opt/hadoop-3.3/bin/hdfs oiv -p delimited -i fsimage_new -o out.csv","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  // PBImageTextWriter visit\n} catch (IOException e) {\n  if (e.getMessage() != null && e.getMessage().startsWith(\"Unrecognized section\")) {\n    // oiv build is older than the image: rerun with a matching-version tool\n    LOG.error(\"oiv too old for this fsimage: {}\", e.getMessage());\n  }\n  throw e;\n}","preventionTips":["Pin the oiv tool version to be at least as new as the image-producing NameNode","After cluster upgrades, refresh every host's Hadoop install used for offline analysis","Log the image's onDiskVersion/layoutVersion alongside failures to speed diagnosis"],"tags":["hdfs","offline-image-viewer","fsimage","version-mismatch"],"backgroundTag":"unsupported-file-version","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}