{"record":{"id":"eb41e43962c534d4","repo":"pentaho/pentaho-kettle","slug":"unable-to-find-step-sourcestepname-to-read-from","errorCode":null,"errorMessage":"Unable to find step '{sourceStepName}' to read from.","messagePattern":"Unable to find step '(.+?)' to read from\\.","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/meta-inject/impl/src/main/java/org/pentaho/di/trans/steps/metainject/MetaInject.java","lineNumber":172,"sourceCode":"      } );\n      injectTrans.prepareExecution( null );\n\n      // See if we need to stream some data over...\n      //\n      RowProducer rowProducer = null;\n      if ( data.streaming ) {\n        rowProducer = injectTrans.addRowProducer( data.streamingTargetStepname, 0 );\n      }\n\n      // Finally, add the mapping transformation to the active sub-transformations\n      // map in the parent transformation\n      //\n      getTrans().addActiveSubTransformation( getStepname(), injectTrans );\n\n      if ( !Utils.isEmpty( meta.getSourceStepName() ) ) {\n        StepInterface stepInterface = injectTrans.getStepInterface( meta.getSourceStepName(), 0 );\n        if ( stepInterface == null ) {\n          throw new KettleException( \"Unable to find step '\" + meta.getSourceStepName() + \"' to read from.\" );\n        }\n        stepInterface.addRowListener( new RowAdapter() {\n          @Override\n          public void rowWrittenEvent( RowMetaInterface rowMeta, Object[] row ) throws KettleStepException {\n            // Just pass along the data as output of this step...\n            //\n            MetaInject.this.putRow( rowMeta, row );\n          }\n        } );\n      }\n\n      injectTrans.startThreads();\n\n      if ( data.streaming ) {\n        // Deplete all the rows from the parent transformation into the modified transformation\n        //\n        RowSet rowSet = findInputRowSet( data.streamingSourceStepname );\n        if ( rowSet == null ) {","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/meta-inject/impl/src/main/java/org/pentaho/di/trans/steps/metainject/MetaInject.java#L154-L190","documentation":"Thrown by MetaInject.processRow() when the source step name configured for metadata injection does not exist in the injected (child) transformation. MetaInject looks up meta.getSourceStepName() in the generated sub-transformation to attach a row listener; a null lookup means the injection target/source mapping references a step name that isn't there.","triggerScenarios":"Running the Meta Inject step when 'source step name' is set but the target (injected) .ktr has no step with that exact name at copy 0 — typically after the child transformation was renamed, deleted, or its steps were changed.","commonSituations":"Child .ktr edited/renamed after configuring injection; case-sensitive step name mismatch; pointing the source step to a step in the parent instead of the injected transformation; variable-derived transformation path resolving to a different file.","solutions":["Open the source .ktr and confirm a step exists whose name exactly matches the Meta Inject 'source step name' (names are case-sensitive)","Re-select the source step in the Meta Inject dialog so the mapping is regenerated against the current child transformation","If the child transformation path comes from a variable, resolve the variable at runtime and verify it points to the intended file","Re-run 'Load transformation' in the Meta Inject dialog to refresh available step names"],"exampleFix":"// before: stale hardcoded name\nmeta.setSourceStepName('Old Data Grid');\n// after: name matching the current child step\nmeta.setSourceStepName('Data Grid');","handlingStrategy":"validation","validationCode":"// Before running, verify the source step exists in the child transformation\nTransMeta child = new TransMeta(childKtrPath);\nif (child.findStep(meta.getSourceStepName()) == null) {\n  throw new IllegalStateException(\"Source step '\" + meta.getSourceStepName() + \"' not in child ktr\");\n}","typeGuard":"boolean sourceStepExists(TransMeta child, String name) {\n  return name != null && !name.isEmpty() && child.findStep(name) != null;\n}","tryCatchPattern":"try {\n  // run transformation with Meta Inject\n} catch (KettleException e) {\n  if (e.getMessage().contains(\"Unable to find step\")) {\n    log.error('Stale injection source step: re-map in Meta Inject dialog', e);\n  } else throw e;\n}","preventionTips":["Re-generate the injection mapping whenever the child .ktr changes","Treat step names as case-sensitive exact identifiers","Avoid variable-derived child paths in production; pin explicit paths","Diff child .ktr changes in version control to catch renamed steps"],"tags":["metadata-injection","step-not-found","configuration"],"backgroundTag":"resource-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"}