{"record":{"id":"1b4c28cb9aa3d64b","repo":"pentaho/pentaho-kettle","slug":"checksum-error-unknownchecksumtype","errorCode":"CheckSum.Error.UnknownChecksumType","errorMessage":"CheckSum.Error.UnknownChecksumType","messagePattern":"CheckSum\\.Error\\.UnknownChecksumType","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/checksum/CheckSum.java","lineNumber":188,"sourceCode":"  }\n\n  private void initializeChecksumCalculator() throws KettleException {\n    try {\n      switch ( meta.getCheckSumType() ) {\n        case CheckSumMeta.TYPE_MD5:\n        case CheckSumMeta.TYPE_SHA1:\n        case CheckSumMeta.TYPE_SHA256:\n          data.checksumCalculator =\n              new DigestChecksumCalculator( MessageDigest.getInstance( meta.getCheckSumType() ) );\n          break;\n        case CheckSumMeta.TYPE_ADLER32:\n          data.checksumCalculator = new ChecksumChecksumCalculator( new Adler32() );\n          break;\n        case CheckSumMeta.TYPE_CRC32:\n          data.checksumCalculator = new ChecksumChecksumCalculator( new CRC32() );\n          break;\n        default:\n          throw new KettleException(\n          BaseMessages.getString( PKG, \"CheckSum.Error.UnknownChecksumType\", meta.getCheckSumType() ) );\n      }\n    } catch ( KettleException e ) {\n      // Rethrow it\n      throw e;\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"CheckSum.Error.Digest\" ), e );\n    }\n  }\n\n  private void initializeFieldConverters( RowMetaInterface inputRowMeta, int[] fieldIndexMapping ) throws KettleException {\n    data.fieldConverters = new FieldToBytesConverter[ fieldIndexMapping.length ];\n    for ( int i = 0; i < fieldIndexMapping.length; i++ ) {\n      switch ( meta.getEvaluationMethod() ) {\n        case CheckSumMeta.EVALUATION_METHOD_BYTES:\n          data.fieldConverters[ i ] = new BytesToBytesConverter( inputRowMeta, fieldIndexMapping[ i ] );\n          break;\n        case CheckSumMeta.EVALUATION_METHOD_PENTAHO_STRINGS:","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/checksum/CheckSum.java#L170-L206","documentation":"The CheckSum step received a checksum type value that initializeChecksumCalculator's switch does not handle (only MD5, SHA-1, Adler32, CRC32 are supported), so the default branch throws this KettleException naming the type. This indicates stale or corrupted step metadata, since the dialog normally only offers valid types.","triggerScenarios":"In initializeChecksumCalculator (called from processRow): meta.getCheckSumType() returns a value outside the supported CheckSumMeta.TYPE_* constants, falling through to the default case.","commonSituations":"Step metadata loaded from a file produced by a different plugin version with extra/renamed types; metadata injected programmatically with an invalid integer type; hand-edited .ktr changing the checksumtype value.","solutions":["Open the CheckSum step dialog and re-select a supported checksum type (MD5, SHA-1, CRC32, Adler32).","If using Metadata Injection, only inject values from CheckSumMeta.TYPE_* constants.","Recreate the step if the .ktr was hand-edited or comes from an incompatible version.","Check the numeric checksumtype value in the .ktr XML matches a documented constant."],"exampleFix":"// before: injected value\nmeta.setCheckSumType( 99 );\n// after\nmeta.setCheckSumType( CheckSumMeta.TYPE_CRC32 );","handlingStrategy":"type-guard","validationCode":"// Only pass valid constants when injecting metadata\nint type = meta.getCheckSumType();\nboolean valid = type == CheckSumMeta.TYPE_MD5 || type == CheckSumMeta.TYPE_SHA1\n    || type == CheckSumMeta.TYPE_CRC32 || type == CheckSumMeta.TYPE_ADLER32;\nif ( !valid ) { throw new IllegalArgumentException( \"Invalid checksum type: \" + type ); }","typeGuard":"boolean isValidChecksumType( int t ) {\n  return t == CheckSumMeta.TYPE_MD5 || t == CheckSumMeta.TYPE_SHA1\n      || t == CheckSumMeta.TYPE_CRC32 || t == CheckSumMeta.TYPE_ADLER32;\n}","tryCatchPattern":null,"preventionTips":["Always use CheckSumMeta.TYPE_* constants, never magic numbers.","Do not hand-edit checksumtype values in .ktr files.","Verify metadata injection mappings against the plugin version in use."],"tags":["etl","kettle","checksum","enum"],"backgroundTag":"invalid-enum-value","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}