{"record":{"id":"c92fcdd4ae25b716","repo":"pentaho/pentaho-kettle","slug":"we-cannot-get-step","errorCode":null,"errorMessage":"We cannot get step [","messagePattern":"We cannot get step \\[","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/stepsmetrics/StepsMetrics.java","lineNumber":107,"sourceCode":"        if ( stepnames[i].equals( getStepname() ) ) {\n          throw new KettleException( \"You can not get metrics for the current step [\" + stepnames[i] + \"]!\" );\n        }\n        if ( targetSteps != null ) {\n          // We can not metrics from the target steps\n          for ( int j = 0; j < targetSteps.length; j++ ) {\n            if ( stepnames[i].equals( targetSteps[j] ) ) {\n              throw new KettleException( \"You can not get metrics for the target step [\" + targetSteps[j] + \"]!\" );\n            }\n          }\n        }\n\n        int CopyNr = Const.toInt( meta.getStepCopyNr()[i], 0 );\n        StepInterface si = getTrans().getStepInterface( stepnames[i], CopyNr );\n        if ( si != null ) {\n          data.stepInterfaces.put( i, getDispatcher().findBaseSteps( stepnames[i] ).get( CopyNr ) );\n        } else {\n          if ( meta.getStepRequired()[i].equals( StepsMetricsMeta.YES ) ) {\n            throw new KettleException( \"We cannot get step [\" + stepnames[i] + \"] CopyNr=\" + CopyNr + \"!\" );\n          }\n        }\n      }\n\n      data.outputRowMeta = new RowMeta();\n      meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,\n        metaStore );\n    } // end if first\n\n    data.continueLoop = true;\n    // Wait until all specified steps have finished!\n    while ( data.continueLoop && !isStopped() ) {\n      data.continueLoop = false;\n      Iterator<Entry<Integer, StepInterface>> it = data.stepInterfaces.entrySet().iterator();\n      while ( it.hasNext() ) {\n        Entry<Integer, StepInterface> e = it.next();\n        StepInterface step = e.getValue();\n","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/stepsmetrics/StepsMetrics.java#L89-L125","documentation":"StepsMetrics' processRow resolves each configured step name to a StepInterface via the running transformation. When a referenced step (at the given copy number) cannot be found and that step is marked as required in the step's metadata, a KettleException is thrown. This aborts the StepsMetrics step because it cannot monitor a mandatory step that does not exist in the executing transformation.","triggerScenarios":"A step name entered in the StepsMetrics dialog does not exactly match a step in the same transformation, or the configured copy number does not exist for that step (e.g. step has only 1 copy but CopyNr=2), while the 'required' flag is set to Y.","commonSituations":"Renaming or deleting a monitored step after configuring StepsMetrics; copying transformations between environments where a step was removed; typo in step name; configuring copy numbers for steps that are not running multiple copies; running a transformation where the monitored step is on a disabled path that never gets instantiated.","solutions":["Verify each step name in the StepsMetrics settings matches a step in the same transformation (check spelling/case).","Check the configured CopyNr for each monitored step; set it to 0 for single-copy steps.","Set the 'required' flag to N for steps that may be absent so the error becomes a skip instead of a throw.","Re-open the transformation in Spoon and re-select the monitored steps from the dropdown so the metadata is regenerated.","If transformation was exported/copied, ensure all referenced steps exist in the target version."],"exampleFix":"// before (metadata XML references a deleted step)\n<step_name>Old Step Name</step_name>\n<step_copynr>0</step_copynr>\n<step_required>Y</step_required>\n// after (rename to existing step, or mark optional)\n<step_name>New Step Name</step_name>\n<step_copynr>0</step_copynr>\n<step_required>N</step_required>","handlingStrategy":"validation","validationCode":"// Before running the transformation, validate monitored steps exist\nfor ( int i = 0; i < stepsMetricsMeta.getStepName().length; i++ ) {\n  String name = stepsMetricsMeta.getStepName()[i];\n  int copyNr = Const.toInt( stepsMetricsMeta.getStepCopyNr()[i], 0 );\n  if ( transMeta.findStep( name ) == null ) {\n    throw new IllegalStateException( \"Monitored step not found in transformation: \" + name );\n  }\n  if ( \"Y\".equals( stepsMetricsMeta.getStepRequired()[i] ) && copyNr > 0\n       && transMeta.findStep( name ).getCopies() <= copyNr ) {\n    throw new IllegalStateException( \"CopyNr \" + copyNr + \" does not exist for step \" + name );\n  }\n}","typeGuard":"// Kotlin-style null check on the resolved StepInterface before treating it as required\nval si: StepInterface? = trans.getStepInterface(stepName, copyNr)\nval isAvailable: Boolean = si != null\nif (!isAvailable && required) throw IllegalStateException(\"Missing required step $stepName copyNr=$copyNr\")","tryCatchPattern":"try {\n  trans.execute( null );\n} catch ( KettleException e ) {\n  if ( e.getMessage() != null && e.getMessage().startsWith( \"We cannot get step [\" ) ) {\n    log.warn( \"Monitored step missing; check StepsMetrics configuration\", e );\n  } else { throw e; }\n}","preventionTips":["Re-select monitored steps from the Spoon dropdown instead of typing names by hand.","Set 'required' = N for steps that may be absent or disabled.","Keep CopyNr at 0 unless the monitored step actually runs multiple copies.","After renaming/deleting steps, search the transformation XML for stale step_name references."],"tags":["kettle","transformation","step-lookup","configuration"],"backgroundTag":"entity-not-found","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"}