pentaho/pentaho-kettle · error · KettleException

FieldsChangeSequence.Log.CanNotFindField

Error message

FieldsChangeSequence.Log.CanNotFindField

What it means

KettleException thrown by FieldsChangeSequence.processRow() when one of the configured field names cannot be found in the incoming row's metadata (indexOfValue returns < 0). The field name is logged via logError first, then thrown. This step computes a sequence based on changes in the specified fields, so all must exist in the stream.

Solutions

  1. Open the Fields change sequence step and re-select the field names from the current incoming stream.
  2. Add a Select values step upstream to produce/rename the missing fields.
  3. Programmatically, ensure meta.setFieldName(new String[]{...}) lists fields that actually exist in the previous step's output.
  4. Re-run 'Get fields' in the dialog after any upstream changes and re-save.

Example fix

// before
meta.setFieldName(new String[]{"oldField"}); // renamed upstream
// after
meta.setFieldName(new String[]{"newField"}); // matches actual stream field
Defensive patterns

Strategy: validation

Validate before calling

for (String f : meta.getFieldName()) {
  if (previousRowMeta.indexOfValue(f) < 0) {
    throw new IllegalStateException("Field not in stream: " + f);
  }
}

Try / catch

try { trans.execute(...); } catch (KettleException e) { if (e.getMessage().contains("CanNotFindField")) { log.error("reconfigure FieldsChangeSequence fields"); } }

Prevention

When it happens

Trigger: data.previousMeta.indexOfValue(meta.getFieldName()[i]) returns -1 during processRow() because a field configured in the step dialog (or via setFieldName) is not present in the input row.

Common situations: Upstream field renamed or removed; step configured with fields from a different stream; programmatically built transformation passing stale field names; case-sensitivity mismatch.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/fieldschangesequence/FieldsChangeSequence.java:78

    if ( first ) {
      // get the RowMeta
      data.previousMeta = getInputRowMeta().clone();
      data.nextIndexField = data.previousMeta.size();
      data.outputRowMeta = getInputRowMeta().clone();
      meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,
        metaStore );

      if ( meta.getFieldName() == null || meta.getFieldName().length > 0 ) {
        data.fieldnr = meta.getFieldName().length;
        data.fieldnrs = new int[data.fieldnr];
        data.previousValues = new Object[data.fieldnr];
        data.fieldnrsMeta = new ValueMetaInterface[data.fieldnr];
        for ( int i = 0; i < data.fieldnr; i++ ) {
          data.fieldnrs[i] = data.previousMeta.indexOfValue( meta.getFieldName()[i] );
          if ( data.fieldnrs[i] < 0 ) {
            logError( BaseMessages.getString(
              PKG, "FieldsChangeSequence.Log.CanNotFindField", meta.getFieldName()[i] ) );
            throw new KettleException( BaseMessages.getString(
              PKG, "FieldsChangeSequence.Log.CanNotFindField", meta.getFieldName()[i] ) );
          }
          data.fieldnrsMeta[i] = data.previousMeta.getValueMeta( data.fieldnrs[i] );
        }
      } else {
        data.fieldnr = data.previousMeta.size();
        data.fieldnrs = new int[data.fieldnr];
        data.previousValues = new Object[data.fieldnr];
        data.fieldnrsMeta = new ValueMetaInterface[data.fieldnr];
        for ( int i = 0; i < data.previousMeta.size(); i++ ) {
          data.fieldnrs[i] = i;
          data.fieldnrsMeta[i] = data.previousMeta.getValueMeta( i );
        }
      }

      data.startAt = Const.toInt( environmentSubstitute( meta.getStart() ), 1 );
      data.incrementBy = Const.toInt( environmentSubstitute( meta.getIncrement() ), 1 );
      data.seq = data.startAt;

View on GitHub (pinned to f3058517a1)