pentaho/pentaho-kettle · error · KettleValueException

Unknown value ' ' for enum

Error message

Unknown value '{v}' for enum {enumClass}

What it means

The metadata-injection type converter for SystemDataMeta converts an injected string to a SystemDataTypes enum. If the string is not a known type (getTypeFromString falls back to TYPE_SYSTEM_INFO_NONE while the input isn't literally the NONE code), it throws KettleValueException naming the bad value and the target enum class.

Solutions

  1. Correct the injected value to a valid SystemDataTypes code (e.g. 'batch', 'current user', matching getTypeFromString)
  2. Trim/clean the source column feeding the mapping to remove whitespace or BOM characters
  3. Pre-validate the mapping source values against SystemDataTypes.getTypeFromString before running
  4. If the code changed across versions, update the mapping to the current enum code

Example fix

// before (injected value)
"filed name" -> field_type: "Server Hostmame"   // unknown -> exception
// after
"Server hostname" // matches SystemDataTypes code accepted by getTypeFromString
Defensive patterns

Strategy: validation

Validate before calling

// validate every injected field_type before running the mapping
for ( String v : injectedTypes ) {
  if ( SystemDataTypes.getTypeFromString( v ) == null
      && !SystemDataTypes.TYPE_SYSTEM_INFO_NONE.toString().equals( v ) ) {
    throw new IllegalArgumentException( "Invalid SystemDataTypes value: " + v );
  }
}

Type guard

boolean isKnownSystemDataType( String v ) {
  return SystemDataTypes.TYPE_SYSTEM_INFO_NONE.toString().equals( v )
      || SystemDataTypes.getTypeFromString( v ) != null;
}

Try / catch

try {
  converter.string2enum( SystemDataTypes.class, value );
} catch ( KettleValueException e ) {
  logError( e.getMessage() ); // shows offending value and enum class
  // substitute a default or fail the mapping early
}

Prevention

When it happens

Trigger: Metadata injection (e.g. from an Excel/CSV input mapping into a System Data step) supplies a 'field_type' value that is not a valid SystemDataTypes name/code.

Common situations: Typo in the mapping source column, value read from a spreadsheet with wrong casing or trailing whitespace, or a renamed SystemDataTypes code between Pentaho versions.

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/c10799e037060d35. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/systemdata/SystemDataMetaInjectionTypeConverter.java:28

 * Change Date: 2030-06-15
 ******************************************************************************/



package org.pentaho.di.trans.steps.systemdata;

import org.pentaho.di.core.exception.KettleValueException;
import org.pentaho.di.core.injection.InjectionTypeConverter;

public class SystemDataMetaInjectionTypeConverter extends InjectionTypeConverter {

  @Override
  public Enum<?> string2enum( Class<?> enumClass, String v ) throws KettleValueException {
    // For SystemDataMeta, enum should be a SystemDataTypes
    SystemDataTypes type = SystemDataTypes.getTypeFromString( v );
    if ( !SystemDataTypes.TYPE_SYSTEM_INFO_NONE.toString().equals( v ) && type == SystemDataTypes.TYPE_SYSTEM_INFO_NONE ) {
      // Throw exception to let user know entered string was not valid SystemDataType
      throw new KettleValueException( "Unknown value '" + v + "' for enum " + enumClass );
    } else {
      return type;
    }
  }
}

View on GitHub (pinned to f3058517a1)