pentaho/pentaho-kettle · error · KettleException

IfNull.Log.CanNotFindValueType

Error message

IfNull.Log.CanNotFindValueType

What it means

In 'value types' mode, the If Null step validates each configured value type name against ValueMetaInterface.typeCodes. If a configured type name is not one of the known Kettle value types, processRow() throws this KettleException naming the unknown type.

Solutions

  1. Correct the value type name in the If Null dialog to a valid Kettle type (String, Integer, Number, Date, Boolean, etc.)
  2. Re-create the value type entry via the dialog instead of hand-editing the XML/repo record
  3. Check for version mismatch between the tool that wrote the config and the current Kettle version

Example fix

// before
valueTypes: [ { typeName: "int", replaceValue: "0" } ]
// after
valueTypes: [ { typeName: "Integer", replaceValue: "0" } ]
Defensive patterns

Strategy: validation

Validate before calling

List<String> valid = Arrays.asList(ValueMetaInterface.typeCodes);
for (IfNullValueType vt : meta.getValueTypes()) { if (!valid.contains(vt.getTypeName())) throw new IllegalStateException("Bad type: " + vt.getTypeName()); }

Type guard

boolean isValidType(String name) { return Arrays.asList(ValueMetaInterface.typeCodes).contains(name); }

Try / catch

try { trans.execute(null); } catch (KettleException e) { if (e.getMessage().contains("CanNotFindValueType")) { fixTypeName(); } else { throw e; } }

Prevention

When it happens

Trigger: processRow with isSelectValuesType() true and meta.getValueTypes()[i].getTypeName() not present in ValueMetaInterface.typeCodes — an unrecognized type name string was configured.

Common situations: Typo in a value type name (e.g. "int" instead of "Integer"); repository entry edited by hand or by an older plugin version; config written in a different locale or by external tooling.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/0526bbbc9eacfd4d. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/ifnull/IfNull.java:118

        }
      } else if ( meta.isSelectValuesType() ) {
        // Consider only select value types
        if ( meta.getValueTypes() != null && meta.getValueTypes().length > 0 ) {
          // return the real default values
          int typeLength = meta.getValueTypes().length;
          data.defaultValues = new String[typeLength];
          data.defaultMasks = new String[typeLength];
          data.setEmptyString = new boolean[typeLength];

          // return all type codes
          HashSet<String> AlllistTypes = new HashSet<String>();
          for ( int i = 0; i < ValueMetaInterface.typeCodes.length; i++ ) {
            AlllistTypes.add( ValueMetaInterface.typeCodes[i] );
          }

          for ( int i = 0; i < meta.getValueTypes().length; i++ ) {
            if ( !AlllistTypes.contains( meta.getValueTypes()[i].getTypeName() ) ) {
              throw new KettleException( BaseMessages.getString( PKG, "IfNull.Log.CanNotFindValueType", meta
                  .getValueTypes()[i].getTypeName() ) );
            }

            data.ListTypes.put( meta.getValueTypes()[i].getTypeName(), i );
            data.defaultValues[i] = environmentSubstitute( meta.getValueTypes()[i].getTypereplaceValue() );
            data.defaultMasks[i] = environmentSubstitute( meta.getValueTypes()[i].getTypereplaceMask() );
            data.setEmptyString[i] = meta.getValueTypes()[i].isSetTypeEmptyString();
          }

          HashSet<Integer> fieldsSelectedIndex = new HashSet<Integer>();
          for ( int i = 0; i < data.outputRowMeta.size(); i++ ) {
            ValueMetaInterface fieldMeta = data.outputRowMeta.getValueMeta( i );
            if ( data.ListTypes.containsKey( fieldMeta.getTypeDesc() ) ) {
              fieldsSelectedIndex.add( i );
            }
          }
          data.fieldnrs = new int[fieldsSelectedIndex.size()];
          List<Integer> entries = new ArrayList<Integer>( fieldsSelectedIndex );

View on GitHub (pinned to f3058517a1)