pentaho/pentaho-kettle · error · KettleException

MergeRowsMeta.CheckResult.ErrorGettingPrevStepFields

MergeRowsMeta.CheckResult.ErrorGettingPrevStepFields

Error message

MergeRowsMeta.CheckResult.ErrorGettingPrevStepFields

What it means

Thrown by MergeRowsHelper.getReferenceStepsFields (a step-action/helper endpoint invoked via handleStepAction) when retrieving the previous step's field names throws a KettleException. The helper lists field names of the reference stream for the Merge Rows dialog UI; on failure it logs the cause and rethrows with this generic message.

Solutions

  1. Check the server/plugin log for the logged e.getMessage() — the original KettleException describes the real failure.
  2. Connect a valid reference input step to the Merge Rows step before requesting fields.
  3. Reopen the transformation and confirm the upstream step still exists and is named correctly.
  4. Retry the 'Get fields' action after the transformation is fully loaded and saved.
Defensive patterns

Strategy: try-catch

Validate before calling

// Before calling the step action, ensure the reference input step exists and is connected
StepMeta mr = transMeta.findStep("Merge Rows");
if (transMeta.getPrevSteps(mr).isEmpty()) {
  throw new IllegalStateException("Merge Rows has no connected reference input");
}

Try / catch

try {
  Map<String,Object> resp = helper.handleStepAction(...);
} catch (KettleException e) {
  // message is generic; check the logged cause for the real upstream failure
  log.error("getFieldNames failed: ensure reference input is connected", e);
}

Prevention

When it happens

Trigger: Calling the step action (e.g. from Spoon's dialog 'Get Fields') when getFields/prev-step lookup fails — typically the referenced previous step is missing/disconnected, or the repository/transformation metadata cannot resolve the upstream step's row layout.

Common situations: Clicking 'Get fields' in the Merge Rows dialog while the reference input is not connected; upstream step renamed or deleted; metadata cannot be resolved because the transformation is not fully loaded.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/mergerows/MergeRowsHelper.java:97

   * @throws KettleException if an error occurs while retrieving the fields
   */
  @SuppressWarnings( "unchecked" )
  public JSONObject getReferenceStepsFields( TransMeta transMeta ) throws KettleException {
    JSONObject response = new JSONObject();
    JSONArray stepFieldsNames = new JSONArray();
    try {
      List<StreamInterface> infoStreams = mergeRowsMeta.getStepIOMeta().getInfoStreams();
      if ( CollectionUtils.isNotEmpty( infoStreams ) ) {
        String stepName = infoStreams.get( 0 ).getStepname();
        StepMeta stepMeta = transMeta.findStep( stepName );
        String[] fields = transMeta.getStepFields( stepMeta ).getFieldNames();

        stepFieldsNames.addAll( Arrays.asList( fields ) );
      }
      response.put( "stepFieldsNames", stepFieldsNames );
    } catch ( KettleException e ) {
      log.logError( e.getMessage() );
      throw new KettleException(
        BaseMessages.getString( PKG, "MergeRowsMeta.CheckResult.ErrorGettingPrevStepFields" ) );
    } catch ( Exception e ) {
      log.logError( e.getMessage() );
      response.put( StepInterface.ACTION_STATUS, StepInterface.FAILURE_RESPONSE );
    }
    return response;
  }
}

View on GitHub (pinned to f3058517a1)