apache/hadoop · error · IllegalStateException

Unknown type:

Error message

Unknown type: 

What it means

Error "Unknown type: " thrown in apache/hadoop.

Source

Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/protocolPB/PBHelper.java:89

      symlink = new Path(proto.getSymlink());
      blocksize = 0;
      length = 0;
      blockReplication = 0;
      break;
    case FT_FILE:
      isdir = false;
      symlink = null;
      blocksize = proto.getBlockSize();
      length = proto.getLength();
      int brep = proto.getBlockReplication();
      if ((brep & 0xffff0000) != 0) {
        throw new IOException(String.format("Block replication 0x%08x " +
            "doesn't fit in 16 bits.", brep));
      }
      blockReplication = (short)brep;
      break;
    default:
      throw new IllegalStateException("Unknown type: " + proto.getFileType());
    }
    path = new Path(proto.getPath());
    mtime = proto.getModificationTime();
    atime = proto.getAccessTime();
    permission = convert(proto.getPermission());
    owner = StringInterner.weakIntern(proto.getOwner());
    group = StringInterner.weakIntern(proto.getGroup());
    int flags = proto.getFlags();
    FileStatus fileStatus = new FileStatus(length, isdir, blockReplication,
        blocksize, mtime, atime, permission, owner, group, symlink, path,
        FileStatus.attributes(
          (flags & FileStatusProto.Flags.HAS_ACL_VALUE) != 0,
          (flags & FileStatusProto.Flags.HAS_CRYPT_VALUE) != 0,
          (flags & FileStatusProto.Flags.HAS_EC_VALUE) != 0,
          (flags & FileStatusProto.Flags.SNAPSHOT_ENABLED_VALUE) != 0));
    return fileStatus;
  }

View on GitHub (pinned to 2add963021)

Solutions

  1. Pass a recognized enum/type value; the received type is unknown to PBHelper.
  2. Check that client and server versions agree on the enum values being converted.

When it happens

Trigger: Thrown in PBHelper.convert when an unrecognized block type value is encountered during protobuf conversion.

Common situations: See trigger scenarios.


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