pentaho/pentaho-kettle · error · RuntimeException

A server socket allocation always has to accompanied by a…

Error message

A server socket allocation always has to accompanied by a source step name but it was empty

What it means

Thrown by TransformationMap.allocateServerSocketPort when sourceStepName is empty. Socket allocations are keyed by the sending step so the slave server can route the opened port to the correct step data stream. The check runs before any port is reserved.

Solutions

  1. Ensure the clustered hop's source step exists and has a name in the transformation
  2. Pass the correct source step name when allocating the socket
  3. Validate with Utils.isEmpty( sourceStepName ) before the call

Example fix

// before
map.allocateServerSocketPort( 40000, host, trans, src, tgt, "", "stepB", "0", "0" );
// after
map.allocateServerSocketPort( 40000, host, trans, src, tgt, sourceStep.getName(), "stepB", "0", "0" );
Defensive patterns

Strategy: validation

Validate before calling

if ( Utils.isEmpty( sourceStepName ) ) {
  throw new IllegalArgumentException( "source step name required" );
}

Type guard

boolean hasStep(String s) { return s != null && !s.trim().isEmpty(); }

Try / catch

try {
  map.allocateServerSocketPort( port, host, trans, src, tgt, srcStep, tgtStep, c1, c2 );
} catch ( RuntimeException e ) {
  if ( e.getMessage().contains( "source step" ) ) {
    // fix dangling hop source step reference
  }
}

Prevention

When it happens

Trigger: Calling allocateServerSocketPort with sourceStepName=null or ""; clustered hop whose source step reference is blank in the transformation meta.

Common situations: Step renamed or deleted from the clustered transformation leaving a dangling hop; programmatically registering translog/socket ports without step names; corrupt .ktr XML.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/www/TransformationMap.java:185

    }
    if ( Utils.isEmpty( hostname ) ) {
      throw new RuntimeException(
        "A server socket allocation always has to accompanied by a hostname but it was empty" );
    }
    if ( Utils.isEmpty( transformationName ) ) {
      throw new RuntimeException(
        "A server socket allocation always has to accompanied by a transformation name but it was empty" );
    }
    if ( Utils.isEmpty( sourceSlaveName ) ) {
      throw new RuntimeException(
        "A server socket allocation always has to accompanied by a source slave server name but it was empty" );
    }
    if ( Utils.isEmpty( targetSlaveName ) ) {
      throw new RuntimeException(
        "A server socket allocation always has to accompanied by a target slave server name but it was empty" );
    }
    if ( Utils.isEmpty( sourceStepName ) ) {
      throw new RuntimeException(
        "A server socket allocation always has to accompanied by a source step name but it was empty" );
    }
    if ( Utils.isEmpty( targetStepName ) ) {
      throw new RuntimeException(
        "A server socket allocation always has to accompanied by a target step name but it was empty" );
    }
    if ( Utils.isEmpty( sourceStepCopy ) ) {
      throw new RuntimeException(
        "A server socket allocation always has to accompanied by a source step copy but it was empty" );
    }
    if ( Utils.isEmpty( targetStepCopy ) ) {
      throw new RuntimeException(
        "A server socket allocation always has to accompanied by a target step copy but it was empty" );
    }

      // Look up the sockets list for the given host
      //
    List<SocketPortAllocation> serverSocketPorts;

View on GitHub (pinned to f3058517a1)