pentaho/pentaho-kettle · error · RuntimeException

The source and target step/copy can't be the same for a…

Error message

The source and target step/copy can't be the same for a remote step definition.

What it means

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.

Solutions

  1. Set targetStep/targetStepCopyNr to a different step (or copy number) than the source.
  2. Review the transformation's cluster schema assignment to ensure the remote hop connects two distinct steps.
  3. If splitting rows across copies, increment the copy numbers rather than reusing the same one.

Example fix

// before
new RemoteStep("Trans Smtp", 0, "Trans Smtp", 0, host, host, port, rowMeta, null);
// after
new RemoteStep("Trans Smtp", 0, "Trans Output", 0, host, host, port, rowMeta, null);
Defensive patterns

Strategy: validation

Validate before calling

// Validate before constructing
if (sourceStep.equals(targetStep) && sourceStepCopyNr == targetStepCopyNr) {
  throw new IllegalArgumentException("Remote step source and target must differ");
}

Try / catch

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; } }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/ffe0f5ae36da4537. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/step/RemoteStep.java:152

    int bufferSize, boolean compressingStreams, RowMetaInterface rowMeta ) {
    super();
    this.hostname = hostname;
    this.remoteHostname = remoteHostname;
    this.port = port;
    this.sourceStep = sourceStep;
    this.sourceStepCopyNr = sourceStepCopyNr;
    this.targetStep = targetStep;
    this.targetStepCopyNr = targetStepCopyNr;
    this.bufferSize = bufferSize;
    this.compressingStreams = compressingStreams;

    this.sourceSlaveServerName = sourceSlaveServerName;
    this.targetSlaveServerName = targetSlaveServerName;

    this.rowMeta = rowMeta;

    if ( sourceStep.equals( targetStep ) && sourceStepCopyNr == targetStepCopyNr ) {
      throw new RuntimeException(
        "The source and target step/copy can't be the same for a remote step definition." );
    }
  }

  @Override
  public Object clone() {
    try {
      return super.clone();
    } catch ( CloneNotSupportedException e ) {
      return null;
    }
  }

  public String getXML() {
    StringBuilder xml = new StringBuilder( 200 );
    xml.append( XMLHandler.openTag( XML_TAG ) );

    xml.append( XMLHandler.addTagValue( "hostname", hostname, false ) );

View on GitHub (pinned to f3058517a1)