{"record":{"id":"a081f6f9abf625ab","repo":"apache/hadoop","slug":"block-found-without-numbytes","errorCode":null,"errorMessage":"<block> found without <numBytes>","messagePattern":"<block> found without <numBytes>","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":757,"sourceCode":"  }\n\n  private HdfsProtos.BlockProto.Builder createBlockBuilder(Node block)\n      throws IOException {\n    HdfsProtos.BlockProto.Builder blockBld =\n        HdfsProtos.BlockProto.newBuilder();\n    Long id = block.removeChildLong(SECTION_ID);\n    if (id == null) {\n      throw new IOException(\"<block> found without <id>\");\n    }\n    blockBld.setBlockId(id);\n    Long genstamp = block.removeChildLong(INODE_SECTION_GENSTAMP);\n    if (genstamp == null) {\n      throw new IOException(\"<block> found without <genstamp>\");\n    }\n    blockBld.setGenStamp(genstamp);\n    Long numBytes = block.removeChildLong(INODE_SECTION_NUM_BYTES);\n    if (numBytes == null) {\n      throw new IOException(\"<block> found without <numBytes>\");\n    }\n    blockBld.setNumBytes(numBytes);\n    return blockBld;\n  }\n\n  private void processDirectoryXml(Node node,\n          INodeSection.INode.Builder inodeBld) throws IOException {\n    inodeBld.setType(INodeSection.INode.Type.DIRECTORY);\n    INodeSection.INodeDirectory.Builder bld =\n        createINodeDirectoryBuilder(node);\n    inodeBld.setDirectory(bld);\n    // Will check remaining keys and serialize in processINodeXml\n  }\n\n  private INodeSection.INodeDirectory.Builder\n      createINodeDirectoryBuilder(Node node) throws IOException {\n    INodeSection.INodeDirectory.Builder bld =\n        INodeSection.INodeDirectory.newBuilder();","sourceCodeStart":739,"sourceCodeEnd":775,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/OfflineImageReconstructor.java#L739-L775","documentation":"Error \"<block> found without <numBytes>\" thrown in apache/hadoop.","triggerScenarios":"Thrown by oiv -r when a <block> stanza in the fsimage XML is missing its mandatory <numBytes> element.","commonSituations":"See trigger scenarios.","solutions":["Add the missing <numBytes> element to the <block> stanza in the fsimage XML.","Regenerate the fsimage XML with 'hdfs oiv' from a valid fsimage."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}