{"record":{"id":"e71638010f20b6be","repo":"apache/hadoop","slug":"unrecognized-section-s-getname","errorCode":null,"errorMessage":"Unrecognized section {s.getName()}","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/FSImageLoader.java","lineNumber":164,"sourceCode":"              }\n            }\n          });\n\n      for (FsImageProto.FileSummary.Section s : sections) {\n        fin.getChannel().position(s.getOffset());\n        InputStream is = FSImageUtil.wrapInputStreamForCompression(conf,\n            summary.getCodec(), new BufferedInputStream(new LimitInputStream(\n            fin, s.getLength())));\n\n        if (LOG.isDebugEnabled()) {\n          LOG.debug(\"Loading section \" + s.getName() + \" length: \" + s.getLength\n              ());\n        }\n\n        FSImageFormatProtobuf.SectionName sectionName\n            = FSImageFormatProtobuf.SectionName.fromString(s.getName());\n        if (sectionName == null) {\n          throw new IOException(\"Unrecognized section \" + s.getName());\n        }\n        switch (sectionName) {\n          case STRING_TABLE:\n            stringTable = loadStringTable(is);\n            break;\n          case INODE:\n            inodes = loadINodeSection(is);\n            break;\n          case INODE_REFERENCE:\n            refIdList = loadINodeReferenceSection(is);\n            break;\n          case INODE_DIR:\n            dirmap = loadINodeDirectorySection(is, refIdList);\n            break;\n          default:\n            break;\n        }\n      }","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/FSImageLoader.java#L146-L182","documentation":"After reading the fsimage FileSummary, FSImageLoader iterates its sections and maps each section name through FSImageFormatProtobuf.SectionName.fromString(); an unknown name returns null and this IOException is thrown. It means the image contains a section type this oiv build does not know — classically an fsimage written by a newer Hadoop being read by an older tool.","triggerScenarios":"Running an older hadoop distribution's oiv against an fsimage from a newer release that introduced new section names (e.g. erasure-coding-era sections added after this build); images written by patched NameNodes with custom sections.","commonSituations":"Version skew between the analysis workstation's Hadoop and the cluster; images copied from a newer cluster analyzed with stale tooling; images captured mid rolling-upgrade.","solutions":["Run oiv from a Hadoop distribution at least as new as the NameNode that wrote the fsimage.","Compare hadoop version on both sides; the section names your build understands are exactly the enum constants in FSImageFormatProtobuf.SectionName.","Since oiv needs no cluster access, just upgrade the tool box's Hadoop to the cluster version or newer."],"exampleFix":"# before (workstation has old hadoop)\n/opt/hadoop-2.7/bin/hdfs oiv -i fsimage_new -p XML -o out.xml\n# -> Unrecognized section ...\n\n# after (use the cluster's version or newer)\n/opt/hadoop-3.3/bin/hdfs oiv -i fsimage_new -p XML -o out.xml","handlingStrategy":"try-catch","validationCode":"// before loading, confirm the tool knows every section in the image summary\nfor (FileSummary.Section s : summary.getSectionsList()) {\n  if (FSImageFormatProtobuf.SectionName.fromString(s.getName()) == null) {\n    throw new IOException(\"Image needs a newer oiv; unknown section \" + s.getName());\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  FSImageLoader.load(inputFile);\n} catch (IOException e) {\n  if (e.getMessage() != null && e.getMessage().startsWith(\"Unrecognized section\")) {\n    // version skew: rerun with an oiv at least as new as the cluster that wrote the image\n    throw new IOException(\"oiv too old for this fsimage: \" + e.getMessage(), e);\n  }\n  throw e;\n}","preventionTips":["Keep the analysis host's Hadoop version >= the cluster's version.","Automate fsimage analysis with the cluster's own hadoop distro.","Treat unknown-section errors as version skew first; check hadoop version before debugging data."],"tags":["hdfs","offline-image-viewer","oiv","fsimage","version-skew","protobuf"],"backgroundTag":"format-version-mismatch","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}