pentaho/pentaho-kettle · error · KettleException

JobExecutor.Exception.GroupFieldNotFound

JobExecutor.Exception.GroupFieldNotFound

Error message

JobExecutor.Exception.GroupFieldNotFound

What it means

Thrown by the JobExecutor step's processRow when a 'group field' is configured on the step but the column name does not exist in the incoming row metadata. The step looks up the field index via indexOfValue(); a return of -1 (field absent from the input stream) triggers this KettleException, naming the missing field.

Solutions

  1. Open the JobExecutor step dialog and correct the group field name to match an actual field in the incoming stream
  2. Preview the input of the step (right-click > Preview) to see the actual field names and fix case/whitespace mismatches
  3. If grouping is not needed, clear the group field setting entirely so the code skips the lookup
  4. Re-add the missing field in the upstream step or insert a 'Select values' step to add/rename the field before JobExecutor

Example fix

// before (upstream field renamed from 'group_id' to 'groupId')
Group field: group_id  -> throws GroupFieldNotFound
// after
Group field: groupId   (or rename the upstream field back to group_id)
Defensive patterns

Strategy: validation

Validate before calling

// Before running the transformation, verify the group field exists in the input layout
RowMetaInterface inputRowMeta = trans.getTransMeta().getPrevStepFields(stepName);
if ( inputRowMeta.indexOfValue( groupFieldName ) < 0 ) {
  throw new IllegalArgumentException(
    "Group field '" + groupFieldName + "' not present in input of step " + stepName );
}

Type guard

boolean hasField(RowMetaInterface rowMeta, String fieldName) {
  return rowMeta != null && fieldName != null && rowMeta.indexOfValue(fieldName) >= 0;
}

Try / catch

try {
  processRow();
} catch ( KettleException e ) {
  if ( e.getMessage().contains("GroupFieldNotFound") ) {
    logError("Configured group field missing from input stream: " + e.getMessage());
    // stop with a clear configuration error rather than retrying
  } else { throw e; }
}

Prevention

When it happens

Trigger: A group field name is entered in the JobExecutor step settings, but the upstream step feeding the transformation was renamed, removed, or never outputs that column, so getInputRowMeta().indexOfValue(data.groupField) returns -1 at runtime.

Common situations: Renaming a field in an upstream Select Values / Text File Input step without updating the JobExecutor step; wiring the step to a different input stream; group field spelled with wrong case or trailing whitespace; copy-pasting step metadata 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/79940da30e54ce68. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/jobexecutor/JobExecutor.java:133

          meta.getFields( getTransMeta().getBowl(),
            data.resultRowsOutputRowMeta, getStepname(), null, meta.getResultRowsTargetStepMeta(), this,
            repository, metaStore );
          data.resultRowsRowSet = findOutputRowSet( meta.getResultRowsTargetStepMeta().getName() );
        }
        if ( meta.getResultFilesTargetStepMeta() != null ) {
          meta.getFields( getTransMeta().getBowl(),
            data.resultFilesOutputRowMeta, getStepname(), null, meta.getResultFilesTargetStepMeta(), this,
            repository, metaStore );
          data.resultFilesRowSet = findOutputRowSet( meta.getResultFilesTargetStepMeta().getName() );
        }

        // Remember which column to group on, if any...
        //
        data.groupFieldIndex = -1;
        if ( !Utils.isEmpty( data.groupField ) ) {
          data.groupFieldIndex = getInputRowMeta().indexOfValue( data.groupField );
          if ( data.groupFieldIndex < 0 ) {
            throw new KettleException( BaseMessages.getString(
              PKG, "JobExecutor.Exception.GroupFieldNotFound", data.groupField ) );
          }
          data.groupFieldMeta = getInputRowMeta().getValueMeta( data.groupFieldIndex );
        }
      }

      // Grouping by field and execution time works ONLY if grouping by size is disabled.
      if ( data.groupSize < 0 ) {
        if ( data.groupFieldIndex >= 0 ) { // grouping by field
          Object groupFieldData = row[data.groupFieldIndex];
          if ( data.prevGroupFieldData != null ) {
            if ( data.groupFieldMeta.compare( data.prevGroupFieldData, groupFieldData ) != 0 ) {
              executeJob();
            }
          }
          data.prevGroupFieldData = groupFieldData;
        } else if ( data.groupTime > 0 ) { // grouping by execution time
          long now = System.currentTimeMillis();

View on GitHub (pinned to f3058517a1)