{"record":{"id":"657db8baa76a148c","repo":"pentaho/pentaho-kettle","slug":"basestreamstepmeta-checkresult-resultstepmissing","errorCode":null,"errorMessage":"BaseStreamStepMeta.CheckResult.ResultStepMissing","messagePattern":"BaseStreamStepMeta\\.CheckResult\\.ResultStepMissing","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/streaming/common/BaseStreamStepMeta.java","lineNumber":276,"sourceCode":"    try {\n      TransMeta transMeta = mappingMetaRetriever.get( bowl, this, repository, metaStore, space );\n      if ( !StringUtil.isEmpty( getSubStep() ) ) {\n        String realSubStepName = space.environmentSubstitute( getSubStep() );\n        if ( transMeta.getSteps().stream().anyMatch( stepMeta -> stepMeta.getName().equals( realSubStepName ) ) ) {\n          rowMeta.addRowMeta( transMeta.getPrevStepFields( realSubStepName ) );\n          transMeta.getSteps().stream().filter( stepMeta -> stepMeta.getName().equals( realSubStepName ) )\n            .findFirst()\n            .ifPresent( stepMeta ->\n            {\n              try {\n                stepMeta.getStepMetaInterface()\n                  .getFields( bowl, rowMeta, origin, info, nextStep, space, repository, metaStore );\n              } catch ( KettleStepException e ) {\n                throw new RuntimeException( e );\n              }\n            } );\n        } else {\n          throw new RuntimeException(\n            BaseMessages.getString( PKG, \"BaseStreamStepMeta.CheckResult.ResultStepMissing\", transMeta.getName(), realSubStepName ) );\n        }\n      }\n    } catch ( KettleException e ) {\n      getLog().logDebug( \"could not get fields, probable AEL\" );\n      rowMeta.addRowMeta( getRowMeta( origin, space ) );\n    }\n  }\n}\n","sourceCodeStart":258,"sourceCodeEnd":286,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/streaming/common/BaseStreamStepMeta.java#L258-L286","documentation":"BaseStreamStepMeta.getFields throws this RuntimeException when the configured result/target sub-step name cannot be found in the transformation metadata, so the fields of the streaming result step cannot be merged into the row metadata. Unlike KettleStepException, it is an unchecked failure that aborts metadata resolution.","triggerScenarios":"getFields looks up realSubStepName among transMeta's steps; the name (after environment substitution) matches no step, so the else-branch throws 'ResultStepMissing'.","commonSituations":"Renamed or deleted the target/result step without updating the streaming step's configuration; variable used in the sub-step name doesn't resolve (also relevant to the test 'testGetFieldsDoesEnvSubstitutionForSubStepName'); copy-paste between transformations referencing a step that doesn't exist in the new one.","solutions":["Open the streaming step's dialog and set the result/target sub-step name to an existing step in the transformation.","Verify any variable in the sub-step name resolves (define it in the transformation or environment properties).","Re-add the deleted/renamed result step, or update the reference after a rename.","If porting steps between transformations, update all cross-step name references."],"exampleFix":"// before: sub-step name points at a missing step\nstreamStep.setSubStepName(\"result_${ENV}\"); // ENV undefined -> no match\n// after: ensure the variable is defined and the step exists\nstreamStep.setSubStepName(\"result_step\"); // actual step name in the transformation","handlingStrategy":"validation","validationCode":"// before running, confirm the configured sub-step exists after variable substitution\nString realName = transMeta.environmentSubstitute(streamStep.getSubStepName());\nif (transMeta.findStep(realName) == null) {\n    throw new IllegalStateException(\"Result step not found: \" + realName);\n}","typeGuard":null,"tryCatchPattern":"try {\n    stepMetaInterface.getFields(/* ... */);\n} catch (RuntimeException e) {\n    if (e.getMessage().contains(\"ResultStepMissing\")) { /* fix step name config */ }\n    throw e;\n}","preventionTips":["Always reference sub-steps by names that exist in the same transformation.","Define all variables used in sub-step names in transformation or environment settings.","After renaming/deleting steps, re-check every streaming step's target reference."],"tags":["streaming","metadata","configuration","kettle"],"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"}