{"record":{"id":"8fc92a97daa4065e","repo":"pentaho/pentaho-kettle","slug":"filterrows-log-targetstepinvalid","errorCode":"FilterRows.Log.TargetStepInvalid","errorMessage":"FilterRows.Log.TargetStepInvalid","messagePattern":"FilterRows\\.Log\\.TargetStepInvalid","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/filterrows/FilterRows.java","lineNumber":93,"sourceCode":"\n    if ( first ) {\n      first = false;\n\n      data.outputRowMeta = getInputRowMeta().clone();\n      meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,\n        metaStore );\n\n      // if filter refers to non-existing fields, throw exception\n      checkNonExistingFields();\n\n      // Cache the position of the RowSet for the output.\n      //\n      if ( data.chosesTargetSteps ) {\n        List<StreamInterface> targetStreams = meta.getStepIOMeta().getTargetStreams();\n        if ( !Utils.isEmpty( targetStreams.get( 0 ).getStepname() ) ) {\n          data.trueRowSet = findOutputRowSet( getStepname(), getCopy(), targetStreams.get( 0 ).getStepname(), 0 );\n          if ( data.trueRowSet == null ) {\n            throw new KettleException( BaseMessages.getString(\n              PKG, \"FilterRows.Log.TargetStepInvalid\", targetStreams.get( 0 ).getStepname() ) );\n          }\n        } else {\n          data.trueRowSet = null;\n        }\n\n        if ( !Utils.isEmpty( targetStreams.get( 1 ).getStepname() ) ) {\n          data.falseRowSet = findOutputRowSet( getStepname(), getCopy(), targetStreams.get( 1 ).getStepname(), 0 );\n          if ( data.falseRowSet == null ) {\n            throw new KettleException( BaseMessages.getString(\n              PKG, \"FilterRows.Log.TargetStepInvalid\", targetStreams.get( 1 ).getStepname() ) );\n          }\n        } else {\n          data.falseRowSet = null;\n        }\n      }\n    }\n","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/filterrows/FilterRows.java#L75-L111","documentation":"When the filter's true-branch is wired to a target step, processRow looks up the corresponding output RowSet with findOutputRowSet. If no running step with the configured target stepname exists, the lookup returns null and this KettleException is thrown - the true target step is invalid or not connected.","triggerScenarios":"processRow(): data.chosesTargetSteps is true, targetStreams.get(0) has a non-empty stepname, but findOutputRowSet(getStepname(), getCopy(), stepname, 0) returns null - the true target step does not exist in the transformation or isn't hop-connected.","commonSituations":"Target step deleted/renamed after the filter was configured; transformation edited via XML where the hop was removed; running an incomplete transformation copy.","solutions":["Open the Filter step dialog and re-select a valid step name in the 'true' target field.","Verify a hop exists from the Filter step to the intended true-branch target step.","If true-rows should go to the main output instead, clear the target step name so data.trueRowSet is set to null."],"exampleFix":"// before (XML)\n<target_stepname>OldStep</target_stepname>\n// after\n<target_stepname>ValidNextStep</target_stepname>","handlingStrategy":"validation","validationCode":"// Verify the true-target step exists and is hop-connected before running:\nStepMeta target = transMeta.findStep(trueTargetName);\nif (target == null || transMeta.findStepTo(stepMeta, target) == null) {\n  throw new IllegalStateException(\"Filter true target step invalid: \" + trueTargetName);\n}","typeGuard":null,"tryCatchPattern":"try {\n  trans.execute(null);\n} catch (KettleException e) {\n  if (e.getMessage().contains(\"TargetStepInvalid\")) {\n    log.error(\"Re-wire the Filter step's target hop\", e);\n  }\n  throw e;\n}","preventionTips":["Re-open and re-save the Filter dialog after renaming/deleting downstream steps.","Avoid renaming target steps without updating the Filter configuration.","Use Spoon's hop validation; don't assemble transformations by editing XML."],"tags":["kettle","hop","target-step"],"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"}