{"record":{"id":"ffe0f5ae36da4537","repo":"pentaho/pentaho-kettle","slug":"the-source-and-target-step-copy-can-t-be-the-same-for-a","errorCode":null,"errorMessage":"The source and target step/copy can't be the same for a remote step definition.","messagePattern":"The source and target step/copy can't be the same for a remote step definition\\.","errorType":"validation","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/step/RemoteStep.java","lineNumber":152,"sourceCode":"    int bufferSize, boolean compressingStreams, RowMetaInterface rowMeta ) {\n    super();\n    this.hostname = hostname;\n    this.remoteHostname = remoteHostname;\n    this.port = port;\n    this.sourceStep = sourceStep;\n    this.sourceStepCopyNr = sourceStepCopyNr;\n    this.targetStep = targetStep;\n    this.targetStepCopyNr = targetStepCopyNr;\n    this.bufferSize = bufferSize;\n    this.compressingStreams = compressingStreams;\n\n    this.sourceSlaveServerName = sourceSlaveServerName;\n    this.targetSlaveServerName = targetSlaveServerName;\n\n    this.rowMeta = rowMeta;\n\n    if ( sourceStep.equals( targetStep ) && sourceStepCopyNr == targetStepCopyNr ) {\n      throw new RuntimeException(\n        \"The source and target step/copy can't be the same for a remote step definition.\" );\n    }\n  }\n\n  @Override\n  public Object clone() {\n    try {\n      return super.clone();\n    } catch ( CloneNotSupportedException e ) {\n      return null;\n    }\n  }\n\n  public String getXML() {\n    StringBuilder xml = new StringBuilder( 200 );\n    xml.append( XMLHandler.openTag( XML_TAG ) );\n\n    xml.append( XMLHandler.addTagValue( \"hostname\", hostname, false ) );","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/step/RemoteStep.java#L134-L170","documentation":"Thrown by the RemoteStep constructor when the source step/copy and target step/copy are identical. A remote step definition describes row flow between two distinct points; a definition where a step sends rows to itself via the same step name and copy number is meaningless and would cause a self-loop.","triggerScenarios":"Constructing new RemoteStep(...) with sourceStep equals targetStep AND sourceStepCopyNr equal to targetStepCopyNr, e.g. programmatically clustering a transformation with identical source/target cluster schema fields.","commonSituations":"Programmatically building clustered transformations where the cluster schema's source/target step fields are copy-pasted values, or splitter logic assigning the same step to both sides of a slave-server hop.","solutions":["Set targetStep/targetStepCopyNr to a different step (or copy number) than the source.","Review the transformation's cluster schema assignment to ensure the remote hop connects two distinct steps.","If splitting rows across copies, increment the copy numbers rather than reusing the same one."],"exampleFix":"// before\nnew RemoteStep(\"Trans Smtp\", 0, \"Trans Smtp\", 0, host, host, port, rowMeta, null);\n// after\nnew RemoteStep(\"Trans Smtp\", 0, \"Trans Output\", 0, host, host, port, rowMeta, null);","handlingStrategy":"validation","validationCode":"// Validate before constructing\nif (sourceStep.equals(targetStep) && sourceStepCopyNr == targetStepCopyNr) {\n  throw new IllegalArgumentException(\"Remote step source and target must differ\");\n}","typeGuard":null,"tryCatchPattern":"try { remoteStep = new RemoteStep(src, srcCopy, tgt, tgtCopy, ...); } catch (RuntimeException e) { if (e.getMessage().contains(\"source and target step/copy can't be the same\")) { fixClusterSchemaAssignment(); } else { throw e; } }","preventionTips":["Never copy-paste source fields into target fields of cluster schema definitions","Programmatically assert source != target when generating clustered transformations","Review cluster schema assignments in Spoon before running clustered executions"],"tags":["kettle","remote-step","cluster","invalid-argument"],"backgroundTag":"invalid-argument-value","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"}