{"record":{"id":"73d4aaeaf0f8156a","repo":"pentaho/pentaho-kettle","slug":"mergerowsmeta-checkresult-errorgettingprevstepfields","errorCode":"MergeRowsMeta.CheckResult.ErrorGettingPrevStepFields","errorMessage":"MergeRowsMeta.CheckResult.ErrorGettingPrevStepFields","messagePattern":"MergeRowsMeta\\.CheckResult\\.ErrorGettingPrevStepFields","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/mergerows/MergeRowsHelper.java","lineNumber":97,"sourceCode":"   * @throws KettleException if an error occurs while retrieving the fields\n   */\n  @SuppressWarnings( \"unchecked\" )\n  public JSONObject getReferenceStepsFields( TransMeta transMeta ) throws KettleException {\n    JSONObject response = new JSONObject();\n    JSONArray stepFieldsNames = new JSONArray();\n    try {\n      List<StreamInterface> infoStreams = mergeRowsMeta.getStepIOMeta().getInfoStreams();\n      if ( CollectionUtils.isNotEmpty( infoStreams ) ) {\n        String stepName = infoStreams.get( 0 ).getStepname();\n        StepMeta stepMeta = transMeta.findStep( stepName );\n        String[] fields = transMeta.getStepFields( stepMeta ).getFieldNames();\n\n        stepFieldsNames.addAll( Arrays.asList( fields ) );\n      }\n      response.put( \"stepFieldsNames\", stepFieldsNames );\n    } catch ( KettleException e ) {\n      log.logError( e.getMessage() );\n      throw new KettleException(\n        BaseMessages.getString( PKG, \"MergeRowsMeta.CheckResult.ErrorGettingPrevStepFields\" ) );\n    } catch ( Exception e ) {\n      log.logError( e.getMessage() );\n      response.put( StepInterface.ACTION_STATUS, StepInterface.FAILURE_RESPONSE );\n    }\n    return response;\n  }\n}\n","sourceCodeStart":79,"sourceCodeEnd":106,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/mergerows/MergeRowsHelper.java#L79-L106","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check the server/plugin log for the logged e.getMessage() — the original KettleException describes the real failure.","Connect a valid reference input step to the Merge Rows step before requesting fields.","Reopen the transformation and confirm the upstream step still exists and is named correctly.","Retry the 'Get fields' action after the transformation is fully loaded and saved."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Before calling the step action, ensure the reference input step exists and is connected\nStepMeta mr = transMeta.findStep(\"Merge Rows\");\nif (transMeta.getPrevSteps(mr).isEmpty()) {\n  throw new IllegalStateException(\"Merge Rows has no connected reference input\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  Map<String,Object> resp = helper.handleStepAction(...);\n} catch (KettleException e) {\n  // message is generic; check the logged cause for the real upstream failure\n  log.error(\"getFieldNames failed: ensure reference input is connected\", e);\n}","preventionTips":["Connect a valid reference input before using 'Get fields' in the dialog.","Avoid renaming/deleting upstream steps while dialogs are open.","Fully load and save the transformation before invoking step actions.","Check server logs for the logged cause message when this error appears."],"tags":["kettle","merge-rows","step-action","field-lookup"],"backgroundTag":"unexpected-response-shape","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}