apache/hadoop · error · IOException

Invalid checksum type in dfs.checksum.type: {}

Error message

Invalid checksum type in dfs.checksum.type: {}

What it means

At NameNode init the configured checksum type is parsed with DataChecksum.Type.valueOf, which requires an exact enum constant name (e.g. CRC32, CRC32C; newer releases add COMPOSITE_CRC). Anything else — wrong case, unknown algorithm, stray whitespace — throws IllegalArgumentException inside the constructor, wrapped into this IOException so startup fails fast with the offending value in the message.

Source

Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java:955

        throw new IOException("Invalid configuration: a shared edits dir " +
            "must not be specified if HA is not enabled.");
      }

      // block manager needs the haEnabled initialized
      this.blockManager = new BlockManager(this, haEnabled, conf);
      this.datanodeStatistics = blockManager.getDatanodeManager().getDatanodeStatistics();

      // Get the checksum type from config
      String checksumTypeStr = conf.get(DFS_CHECKSUM_TYPE_KEY,
          DFS_CHECKSUM_TYPE_DEFAULT);
      this.isSnapshotTrashRootEnabled = conf.getBoolean(
          DFS_NAMENODE_SNAPSHOT_TRASHROOT_ENABLED,
          DFS_NAMENODE_SNAPSHOT_TRASHROOT_ENABLED_DEFAULT);
      DataChecksum.Type checksumType;
      try {
         checksumType = DataChecksum.Type.valueOf(checksumTypeStr);
      } catch (IllegalArgumentException iae) {
         throw new IOException("Invalid checksum type in "
            + DFS_CHECKSUM_TYPE_KEY + ": " + checksumTypeStr);
      }

      try {
        digest = MessageDigest.getInstance("MD5");
      } catch (NoSuchAlgorithmException e) {
        throw new IOException("Algorithm 'MD5' not found");
      }

      this.serverDefaults = new FsServerDefaults(
          conf.getLongBytes(DFS_BLOCK_SIZE_KEY, DFS_BLOCK_SIZE_DEFAULT),
          conf.getInt(DFS_BYTES_PER_CHECKSUM_KEY, DFS_BYTES_PER_CHECKSUM_DEFAULT),
          conf.getInt(DFS_CLIENT_WRITE_PACKET_SIZE_KEY, DFS_CLIENT_WRITE_PACKET_SIZE_DEFAULT),
          (short) conf.getInt(DFS_REPLICATION_KEY, DFS_REPLICATION_DEFAULT),
          conf.getInt(IO_FILE_BUFFER_SIZE_KEY, IO_FILE_BUFFER_SIZE_DEFAULT),
          conf.getBoolean(DFS_ENCRYPT_DATA_TRANSFER_KEY, DFS_ENCRYPT_DATA_TRANSFER_DEFAULT),
          conf.getLong(FS_TRASH_INTERVAL_KEY, FS_TRASH_INTERVAL_DEFAULT),
          checksumType,

View on GitHub (pinned to 2add963021)

Solutions

  1. Set dfs.checksum.type to a valid constant in exact case, e.g. CRC32 (default) or CRC32C
  2. Check the supported values for your version: the enum constants of org.apache.hadoop.util.DataChecksum.Type
  3. Remove stray whitespace or quotes around the value in hdfs-site.xml
  4. Restart the NameNode and confirm startup completes

Example fix

<!-- before -->
<property><name>dfs.checksum.type</name><value>crc32c</value></property>
<!-- after: exact enum constant name -->
<property><name>dfs.checksum.type</name><value>CRC32C</value></property>
Defensive patterns

Strategy: validation

Validate before calling

String v = conf.get(DFSConfigKeys.DFS_CHECKSUM_TYPE_KEY,
    DFSConfigKeys.DFS_CHECKSUM_TYPE_DEFAULT).trim();
try {
  DataChecksum.Type.valueOf(v);
} catch (IllegalArgumentException e) {
  throw new IllegalArgumentException(
      "dfs.checksum.type must be one of "
          + Arrays.toString(DataChecksum.Type.values()));
}

Prevention

When it happens

Trigger: dfs.checksum.type set to a string that is not an exact DataChecksum.Type constant of the running Hadoop version: 'crc32' (lowercase), 'crc32c', 'md5', or a value introduced in a newer release (e.g. COMPOSITE_CRC on an older build).

Common situations: Lowercase values copied from blog posts or defaults files; setting a checksum type the installed version does not know; whitespace or quotes introduced by templating.

Related errors


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