pentaho/pentaho-kettle · error · KettleStepException

ConcatFields.Error.FieldNotFoundInputStream

ConcatFields.Error.FieldNotFoundInputStream

Error message

ConcatFields.Error.FieldNotFoundInputStream

What it means

ConcatFields validates each configured output (source) field exists in the modified input row metadata. If any field listed in the step's output fields is not found in the incoming stream (indexOfValue returns -1), this KettleStepException names the missing field.

Solutions

  1. Add the missing field to the input stream (fix the upstream step producing it).
  2. Update the step's output field list to match fields actually present in the stream.
  3. Re-select fields from the dropdown in the step dialog to refresh names.
  4. In tests, ensure the input RowMeta contains every field listed in meta.getOutputFields().

Example fix

// before
rowMeta.addValueMeta( new ValueMetaString( "wrongName" ) );
// after
rowMeta.addValueMeta( new ValueMetaString( "expectedField" ) );
Defensive patterns

Strategy: validation

Validate before calling

for ( String f : Arrays.stream( meta.getOutputFields() ).map( ConcatField::getName ).collect( toList() ) ) {
  if ( inputRowMeta.indexOfValue( f ) < 0 ) throw new IllegalArgumentException( "Missing input field: " + f );
}

Try / catch

try {
  step.processRow();
} catch ( KettleStepException e ) {
  if ( e.getMessage().contains( "FieldNotFoundInputStream" ) ) {
    logError( "Add or rename the field in the upstream step: " + e.getMessage() );
  }
}

Prevention

When it happens

Trigger: meta.getOutputFields()[i].getName() does not exist in data.inputRowMetaModified — a configured concat source field was renamed, removed upstream, or never existed.

Common situations: Upstream step changes break the field list; users type field names manually instead of picking from the dropdown; tests build input row metadata without all the fields the meta declares.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/concatfields/ConcatFields.java:87

      // the field precisions and lengths are altered! see TextFileOutputMeta.getFields().
      // otherwise trim(), padding etc. will not work
      data.inputRowMetaModified = getInputRowMeta().clone();
      meta
        .getFieldsModifyInput( getTransMeta().getBowl(), data.inputRowMetaModified, getStepname(), null, null,
           this, repository, metaStore );

      data.posTargetField = data.outputRowMeta.indexOfValue( meta.getTargetFieldName() );
      if ( data.posTargetField < 0 ) {
        throw new KettleStepException( BaseMessages.getString(
          PKG, "ConcatFields.Error.TargetFieldNotFoundOutputStream", "" + meta.getTargetFieldName() ) );
      }

      data.fieldnrs = new int[ meta.getOutputFields().length ];
      for ( int i = 0; i < meta.getOutputFields().length; i++ ) {
        data.fieldnrs[ i ] = data.inputRowMetaModified.indexOfValue( meta.getOutputFields()[ i ].getName() );
        if ( data.fieldnrs[ i ] < 0 ) {
          throw new KettleStepException( BaseMessages.getString(
            PKG, "ConcatFields.Error.FieldNotFoundInputStream", "" + meta.getOutputFields()[ i ].getName() ) );
        }
      }

      meta.calcMetaWithFieldOptions( data );

      // prepare for fast data dump (StringBuilder size)
      data.targetFieldLengthFastDataDump = meta.getTargetFieldLength();
      if ( data.targetFieldLengthFastDataDump <= 0 ) { // try it as a guess: 50 * size
        if ( meta.getOutputFields().length == 0 ) {
          data.targetFieldLengthFastDataDump = 50 * getInputRowMeta().size();
        } else {
          data.targetFieldLengthFastDataDump = 50 * meta.getOutputFields().length;
        }
      }
      prepareForReMap();

      checkAndWriteHeader();

View on GitHub (pinned to f3058517a1)