pentaho/pentaho-kettle · error · KettleException

ExecProcess.Exception.CouldnotFindField

Error message

ExecProcess.Exception.CouldnotFindField

What it means

Message key ExecProcess.Exception.CouldnotFindField thrown in ExecProcess.processRow: the configured process field name was not found in the incoming row (indexOfValue returned a negative index for the resolved field name, which is interpolated into the localized message).

Solutions

  1. Verify the field exists in the incoming stream (use 'Preview' / 'Show input fields') and correct the 'Process field' name in the step dialog.
  2. Fix case-sensitivity — field names in Kettle are case-sensitive.
  3. Reconnect or add the upstream step that produces the field.
  4. Use a Select Values / Add constants step to (re)introduce the field before ExecProcess.

Example fix

// before: field 'cmd' no longer on the stream
meta.setProcessField("cmd");
// after: match the actual upstream field name
meta.setProcessField("command"); // or add a Select Values step aliasing cmd -> command
Defensive patterns

Strategy: validation

Validate before calling

// before running: confirm the field is on the stream
RowMetaInterface prev = transMeta.getPrevStepFields(stepMeta);
if (prev.indexOfValue(meta.getProcessField()) < 0) {
  throw new IllegalStateException("Field missing upstream: " + meta.getProcessField());
}

Try / catch

try { trans.execute(); } catch (KettleException e) { if (e.getMessage().contains("CouldnotFindField")) { /* re-map field name */ } }

Prevention

When it happens

Trigger: processRow on first row: meta.getProcessField() is non-empty but data.previousRowMeta.indexOfValue(field) returns -1, i.e. the upstream row metadata contains no field with that exact name.

Common situations: Upstream field renamed or case mismatch; the field-producing step was removed or reordered; spec changed to 'include all fields' variants that drop the field; copy/paste between transformations with different layouts.

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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/execprocess/ExecProcess.java:90

      data.NrPrevFields = data.previousRowMeta.size();
      data.outputRowMeta = data.previousRowMeta;
      meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,
        metaStore );

      // Check is process field is provided
      if ( Utils.isEmpty( meta.getProcessField() ) ) {
        logError( BaseMessages.getString( PKG, "ExecProcess.Error.ProcessFieldMissing" ) );
        throw new KettleException( BaseMessages.getString( PKG, "ExecProcess.Error.ProcessFieldMissing" ) );
      }

      // cache the position of the field
      if ( data.indexOfProcess < 0 ) {
        data.indexOfProcess = data.previousRowMeta.indexOfValue( meta.getProcessField() );
        if ( data.indexOfProcess < 0 ) {
          // The field is unreachable !
          logError( BaseMessages.getString( PKG, "ExecProcess.Exception.CouldnotFindField" )
            + "[" + meta.getProcessField() + "]" );
          throw new KettleException( BaseMessages.getString( PKG, "ExecProcess.Exception.CouldnotFindField", meta
            .getProcessField() ) );
        }
      }
      if ( meta.isArgumentsInFields() ) {
        if ( data.indexOfArguments == null ) {
          data.indexOfArguments = new int[meta.getArgumentFieldNames().length];
          for ( int i = 0; i < data.indexOfArguments.length; i++ ) {
            String fieldName = meta.getArgumentFieldNames()[i];
            data.indexOfArguments[i] = data.previousRowMeta.indexOfValue( fieldName );
            if ( data.indexOfArguments[i] < 0 ) {
              logError( BaseMessages.getString( PKG, "ExecProcess.Exception.CouldnotFindField" )
                + "[" + fieldName + "]" );
              throw new KettleException(
                BaseMessages.getString( PKG, "ExecProcess.Exception.CouldnotFindField", fieldName ) );
            }
          }
        }
      }

View on GitHub (pinned to f3058517a1)