{"record":{"id":"f62ac0ea7057b51f","repo":"apache/hadoop","slug":"invalid-checksum-type-in-dfs-checksum-type","errorCode":null,"errorMessage":"Invalid checksum type in dfs.checksum.type: {}","messagePattern":"Invalid checksum type in dfs\\.checksum\\.type: (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java","lineNumber":955,"sourceCode":"        throw new IOException(\"Invalid configuration: a shared edits dir \" +\n            \"must not be specified if HA is not enabled.\");\n      }\n\n      // block manager needs the haEnabled initialized\n      this.blockManager = new BlockManager(this, haEnabled, conf);\n      this.datanodeStatistics = blockManager.getDatanodeManager().getDatanodeStatistics();\n\n      // Get the checksum type from config\n      String checksumTypeStr = conf.get(DFS_CHECKSUM_TYPE_KEY,\n          DFS_CHECKSUM_TYPE_DEFAULT);\n      this.isSnapshotTrashRootEnabled = conf.getBoolean(\n          DFS_NAMENODE_SNAPSHOT_TRASHROOT_ENABLED,\n          DFS_NAMENODE_SNAPSHOT_TRASHROOT_ENABLED_DEFAULT);\n      DataChecksum.Type checksumType;\n      try {\n         checksumType = DataChecksum.Type.valueOf(checksumTypeStr);\n      } catch (IllegalArgumentException iae) {\n         throw new IOException(\"Invalid checksum type in \"\n            + DFS_CHECKSUM_TYPE_KEY + \": \" + checksumTypeStr);\n      }\n\n      try {\n        digest = MessageDigest.getInstance(\"MD5\");\n      } catch (NoSuchAlgorithmException e) {\n        throw new IOException(\"Algorithm 'MD5' not found\");\n      }\n\n      this.serverDefaults = new FsServerDefaults(\n          conf.getLongBytes(DFS_BLOCK_SIZE_KEY, DFS_BLOCK_SIZE_DEFAULT),\n          conf.getInt(DFS_BYTES_PER_CHECKSUM_KEY, DFS_BYTES_PER_CHECKSUM_DEFAULT),\n          conf.getInt(DFS_CLIENT_WRITE_PACKET_SIZE_KEY, DFS_CLIENT_WRITE_PACKET_SIZE_DEFAULT),\n          (short) conf.getInt(DFS_REPLICATION_KEY, DFS_REPLICATION_DEFAULT),\n          conf.getInt(IO_FILE_BUFFER_SIZE_KEY, IO_FILE_BUFFER_SIZE_DEFAULT),\n          conf.getBoolean(DFS_ENCRYPT_DATA_TRANSFER_KEY, DFS_ENCRYPT_DATA_TRANSFER_DEFAULT),\n          conf.getLong(FS_TRASH_INTERVAL_KEY, FS_TRASH_INTERVAL_DEFAULT),\n          checksumType,","sourceCodeStart":937,"sourceCodeEnd":973,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java#L937-L973","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Set dfs.checksum.type to a valid constant in exact case, e.g. CRC32 (default) or CRC32C","Check the supported values for your version: the enum constants of org.apache.hadoop.util.DataChecksum.Type","Remove stray whitespace or quotes around the value in hdfs-site.xml","Restart the NameNode and confirm startup completes"],"exampleFix":"<!-- before -->\n<property><name>dfs.checksum.type</name><value>crc32c</value></property>\n<!-- after: exact enum constant name -->\n<property><name>dfs.checksum.type</name><value>CRC32C</value></property>","handlingStrategy":"validation","validationCode":"String v = conf.get(DFSConfigKeys.DFS_CHECKSUM_TYPE_KEY,\n    DFSConfigKeys.DFS_CHECKSUM_TYPE_DEFAULT).trim();\ntry {\n  DataChecksum.Type.valueOf(v);\n} catch (IllegalArgumentException e) {\n  throw new IllegalArgumentException(\n      \"dfs.checksum.type must be one of \"\n          + Arrays.toString(DataChecksum.Type.values()));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate enum-valued config keys at deploy time with a pre-start config check","Copy enum values from the version's DataChecksum.Type, not from unversioned blog posts","Prefer trimmed, uppercase values in config templates"],"tags":["hadoop","hdfs","namenode","configuration","checksum","enum-value"],"backgroundTag":"invalid-enum-config-value","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}