{"record":{"id":"7d1fc20c9551f7b9","repo":"apache/hadoop","slug":"unrecognized-section-7d1fc2","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/PBImageXmlWriter.java","lineNumber":332,"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      for (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        SectionName sectionName = SectionName.fromString(s.getName());\n        if (sectionName == null) {\n          throw new IOException(\"Unrecognized section \" + s.getName());\n        }\n        switch (sectionName) {\n        case NS_INFO:\n          dumpNameSection(is);\n          break;\n        case STRING_TABLE:\n          loadStringTable(is);\n          break;\n        case ERASURE_CODING:\n          dumpErasureCodingSection(is);\n          break;\n        case INODE:\n          dumpINodeSection(is);\n          break;\n        case INODE_REFERENCE:\n          dumpINodeReferenceSection(is);\n          break;\n        case INODE_DIR:","sourceCodeStart":314,"sourceCodeEnd":350,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/PBImageXmlWriter.java#L314-L350","documentation":"Same mechanism as the Delimited writer's variant: while iterating the FileSummary section list, SectionName.fromString() returned null for a section name this oiv build does not know. The image was written by a Hadoop newer than the tool, and PBImageXmlWriter aborts rather than silently skip a section.","triggerScenarios":"Running `hdfs oiv -p XML` from an older Hadoop install against a fsimage containing a section type introduced later (the unknown name appears in the message).","commonSituations":"Version-skewed tooling after a cluster upgrade; oiv from an old tarball reused against new images.","solutions":["Run oiv from a distribution at least as new as the NameNode that wrote the image","Copy the fsimage to a host with a matching or newer Hadoop install and run oiv there","No skip flag exists for unknown sections — align tool version with image version"],"exampleFix":"# before\n/opt/hadoop-2.8/bin/hdfs oiv -p XML -i fsimage_new -o out.xml\n# IOException: Unrecognized section ...\n\n# after\n/opt/hadoop-3.3/bin/hdfs oiv -p XML -i fsimage_new -o out.xml","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  new PBImageXmlWriter(conf, out).visit(file);\n} catch (IOException e) {\n  if (e.getMessage() != null && e.getMessage().startsWith(\"Unrecognized section\")) {\n    // tool older than image: rerun with oiv at/above the image's Hadoop version\n    LOG.error(\"oiv too old for this fsimage: {}\", e.getMessage());\n  }\n  throw e;\n}","preventionTips":["Match the oiv tool version to (or above) the image-producing cluster","Treat any 'Unrecognized section' as version skew first, corruption second"],"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"}