{"record":{"id":"f37617e5860366b5","repo":"pentaho/pentaho-kettle","slug":"basestep-exception-targetsteptowritetodoesntexist","errorCode":"BaseStep.Exception.TargetStepToWriteToDoesntExist","errorMessage":"BaseStep.Exception.TargetStepToWriteToDoesntExist","messagePattern":"BaseStep\\.Exception\\.TargetStepToWriteToDoesntExist","errorType":"error_code","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/step/BaseStep.java","lineNumber":2482,"sourceCode":"\n    return null;\n  }\n\n  /**\n   * Find output row set.\n   *\n   * @param targetStep the target step\n   * @return the row set\n   * @throws KettleStepException the kettle step exception\n   */\n  public RowSet findOutputRowSet( String targetStep ) throws KettleStepException {\n\n    // Check to see that \"targetStep\" only runs in a single copy\n    // Otherwise you'll see problems during execution.\n    //\n    StepMeta targetStepMeta = transMeta.findStep( targetStep );\n    if ( targetStepMeta == null ) {\n      throw new KettleStepException( BaseMessages.getString(\n        PKG, \"BaseStep.Exception.TargetStepToWriteToDoesntExist\", targetStep ) );\n    }\n\n    if ( targetStepMeta.getCopies() > 1 ) {\n      throw new KettleStepException( BaseMessages.getString(\n        PKG, \"BaseStep.Exception.TargetStepToWriteToCantRunInMultipleCopies\", targetStep, Integer\n          .toString( targetStepMeta.getCopies() ) ) );\n    }\n\n    return findOutputRowSet( getStepname(), getCopy(), targetStep, 0 );\n  }\n\n  /**\n   * Find an output rowset in a running transformation. It will also look at the \"to\" step to see if this is a mapping.\n   * If it is, it will find the appropriate rowset in that transformation.\n   *\n   * @param from\n   * @param fromcopy","sourceCodeStart":2464,"sourceCodeEnd":2500,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/step/BaseStep.java#L2464-L2500","documentation":"The write-side counterpart of findInputRowSet: findOutputRowSet(String targetStep) resolves the named target step via transMeta.findStep and throws KettleStepException when no step with that name exists in the transformation. The step tried to write rows to a row set for a target that is not part of the transformation.","triggerScenarios":"Calling BaseStep.findOutputRowSet(\"SomeStep\") (or a plugin configured with a target step name) where the name does not match any step in the current transformation: typo, renamed/deleted step, or target defined in another transformation.","commonSituations":"Renaming the target step after configuring a plugin that writes into it; mapping/sub-transformations hiding the target; hard-coded target names in custom step code.","solutions":["Correct the target step name in the writing step's configuration to match a step that exists in this transformation.","Re-open the step dialog and re-select the target step from the dropdown.","Ensure the target step is actually connected (hop drawn) to the writing step if the plugin relies on direct hops.","In custom code, validate transMeta.findStep(name) != null before writing, or use parameters for the name."],"exampleFix":"// before\nRowSet rs = findOutputRowSet(\"Outpt\"); // typo\n// after\nRowSet rs = findOutputRowSet(\"Output\");","handlingStrategy":"validation","validationCode":"if (transMeta.findStep(targetStepName) == null) throw new IllegalArgumentException(\"Target step '\" + targetStepName + \"' not found in transformation\");","typeGuard":null,"tryCatchPattern":"try { RowSet rs = findOutputRowSet(targetStepName); } catch (KettleStepException e) { if (e.getMessage().contains(\"exist\")) { logError(\"Target step name invalid: \" + targetStepName); } throw e; }","preventionTips":["Ensure the target hop exists and is spelled exactly as on canvas","Re-open step dialogs after renames to refresh stored names","Validate target names at plugin configuration time (dialog check)","Use variables instead of hard-coded step names in custom code"],"tags":["kettle","pentaho","step-not-found","rowset","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"}