apache/hadoop · error · IOException

INode XML found with unknown

Error message

INode XML found with unknown <blocktype> {blockType}

What it means

Malformed-XML guard in createINodeFileBuilder: the <blocktype> element's value matched neither CONTIGUOUS nor STRIPED, so the file's block layout cannot be mapped to a BlockTypeProto and reconstruction aborts.

Solutions

  1. Use a valid <blocktype> value (e.g. CONTIGUOUS or STRIPED) in the fsimage XML.
  2. Regenerate the fsimage XML with the matching version of 'hdfs oiv' so block types are emitted correctly.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown by oiv -r when a block stanza carries a <blocktype> value that is not a recognized BlockType (e.g. CONTIGUOUS/STRIPED), indicating corrupt or incompatible fsimage XML.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/d03e4aeee4600d29. Report an issue: GitHub.

Appendix: source

Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/OfflineImageReconstructor.java:734

    ival = node.removeChildInt(INODE_SECTION_STORAGE_POLICY_ID);
    if (ival != null) {
      bld.setStoragePolicyID(ival);
    }
    String blockType = node.removeChildStr(INODE_SECTION_BLOCK_TYPE);
    if(blockType != null) {
      switch (blockType) {
      case "CONTIGUOUS":
        bld.setBlockType(HdfsProtos.BlockTypeProto.CONTIGUOUS);
        break;
      case "STRIPED":
        bld.setBlockType(HdfsProtos.BlockTypeProto.STRIPED);
        ival = node.removeChildInt(INODE_SECTION_EC_POLICY_ID);
        if (ival != null) {
          bld.setErasureCodingPolicyID(ival);
        }
        break;
      default:
        throw new IOException("INode XML found with unknown <blocktype> " +
            blockType);
      }
    }
    return bld;
  }

  private HdfsProtos.BlockProto.Builder createBlockBuilder(Node block)
      throws IOException {
    HdfsProtos.BlockProto.Builder blockBld =
        HdfsProtos.BlockProto.newBuilder();
    Long id = block.removeChildLong(SECTION_ID);
    if (id == null) {
      throw new IOException("<block> found without <id>");
    }
    blockBld.setBlockId(id);
    Long genstamp = block.removeChildLong(INODE_SECTION_GENSTAMP);
    if (genstamp == null) {
      throw new IOException("<block> found without <genstamp>");

View on GitHub (pinned to 2add963021)