pentaho/pentaho-kettle · error · KettleStepException

KettleStepException(e)

Error message

KettleStepException(e)

What it means

KettleStepException wrapping an Exception thrown by JsonInputMeta.getFields() while converting each configured JsonInputField to a ValueMetaInterface via field.toValueMeta(name, space). It surfaces when a field definition is invalid (bad conversion format/type) so the output row metadata cannot be built.

Solutions

  1. Open the JSON Input step's Fields tab and fix the Format column for the failing field (use a valid SimpleDateFormat mask for Date, e.g. yyyy-MM-dd'T'HH:mm:ss).
  2. Change the field Type to String if no conversion format is needed.
  3. Resolve any ${VARIABLE} used in the format/length settings — ensure it's defined at runtime.
  4. Recreate the field definition from scratch to reset stale metadata.

Example fix

// before: field config
path=$.ts, type=Date, format=not-a-date-pattern
// after
path=$.ts, type=Date, format=yyyy-MM-dd'T'HH:mm:ss'Z'
Defensive patterns

Strategy: validation

Validate before calling

// validate field definitions before building metadata
for (JsonInputField f : meta.getInputFields()) {
  if (f.getType() == ValueMetaInterface.TYPE_DATE && (f.getFormat() == null || f.getFormat().isEmpty()))
    throw new IllegalArgumentException("Date field " + f.getName() + " needs a format mask");
}

Try / catch

try { meta.getFields(row, name, info, space, null); }
catch (KettleStepException e) { throw new IllegalStateException("Invalid field config: " + e.getCause(), e); }

Prevention

When it happens

Trigger: getFields -> field.toValueMeta: exception while applying conversion metadata, e.g. an invalid conversion mask/date format for a Date/Timestamp/Number field type, or unsupported type string resolved with the variable space.

Common situations: A JSON Input field configured with type=Date but an invalid or locale-mismatched format mask; field definitions copied from another step with incompatible types; environment variables in the format string unresolvable.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


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

Appendix: source

Thrown at plugins/json/core/src/main/java/org/pentaho/di/trans/steps/jsoninput/JsonInputMeta.java:838

  }

  @Override
  public void getFields( Bowl bowl, RowMetaInterface rowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,
      VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {

    if ( inFields && removeSourceField && !Utils.isEmpty( valueField ) ) {
      int index = rowMeta.indexOfValue( valueField );
      if ( index != -1 ) {
        rowMeta.removeValueMeta( index );
      }
    }

    for ( JsonInputField field : getInputFields() ) {
      try {
        rowMeta.addValueMeta( field.toValueMeta( name, space ) );
      } catch ( Exception e ) {
        throw new KettleStepException( e );
      }
    }

    if ( includeFilename ) {
      ValueMetaInterface v = new ValueMetaString( space.environmentSubstitute( filenameField ) );
      v.setLength( 250 );
      v.setPrecision( -1 );
      v.setOrigin( name );
      rowMeta.addValueMeta( v );
    }

    if ( includeRowNumber ) {
      ValueMetaInterface v = new ValueMetaInteger( space.environmentSubstitute( rowNumberField ) );
      v.setLength( ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0 );
      v.setOrigin( name );
      rowMeta.addValueMeta( v );
    }
    // Add additional fields

View on GitHub (pinned to f3058517a1)