{"record":{"id":"c7b2f023d01f9585","repo":"pentaho/pentaho-kettle","slug":"a-server-socket-allocation-always-has-to-accompanied-by-a-c7b2f0","errorCode":null,"errorMessage":"A server socket allocation always has to accompanied by a target slave server name but it was empty","messagePattern":"A server socket allocation always has to accompanied by a target slave server name but it was empty","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/www/TransformationMap.java","lineNumber":181,"sourceCode":"    if ( portRangeStart <= 0 ) {\n      throw new RuntimeException(\n        \"A server socket allocation always has to accompanied by port range start > 0 but it was \"\n          + portRangeStart );\n    }\n    if ( Utils.isEmpty( hostname ) ) {\n      throw new RuntimeException(\n        \"A server socket allocation always has to accompanied by a hostname but it was empty\" );\n    }\n    if ( Utils.isEmpty( transformationName ) ) {\n      throw new RuntimeException(\n        \"A server socket allocation always has to accompanied by a transformation name but it was empty\" );\n    }\n    if ( Utils.isEmpty( sourceSlaveName ) ) {\n      throw new RuntimeException(\n        \"A server socket allocation always has to accompanied by a source slave server name but it was empty\" );\n    }\n    if ( Utils.isEmpty( targetSlaveName ) ) {\n      throw new RuntimeException(\n        \"A server socket allocation always has to accompanied by a target slave server name but it was empty\" );\n    }\n    if ( Utils.isEmpty( sourceStepName ) ) {\n      throw new RuntimeException(\n        \"A server socket allocation always has to accompanied by a source step name but it was empty\" );\n    }\n    if ( Utils.isEmpty( targetStepName ) ) {\n      throw new RuntimeException(\n        \"A server socket allocation always has to accompanied by a target step name but it was empty\" );\n    }\n    if ( Utils.isEmpty( sourceStepCopy ) ) {\n      throw new RuntimeException(\n        \"A server socket allocation always has to accompanied by a source step copy but it was empty\" );\n    }\n    if ( Utils.isEmpty( targetStepCopy ) ) {\n      throw new RuntimeException(\n        \"A server socket allocation always has to accompanied by a target step copy but it was empty\" );\n    }","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/www/TransformationMap.java#L163-L199","documentation":"Thrown by TransformationMap.allocateServerSocketPort when targetSlaveName is empty. The allocation must know which slave receives the data so the port can be linked from source slave to target slave in the socket repository. The check runs before any port is reserved.","triggerScenarios":"Calling allocateServerSocketPort with targetSlaveName=null or \"\"; cluster schema missing the target (receiving) slave server for the hop being clustered.","commonSituations":"Incomplete master-to-slave cluster definition; target slave removed from cluster schema but hops still reference it; programmatic cluster config that only sets the source slave.","solutions":["Add the target SlaveServer to the cluster schema and ensure the hop references it","Pass the correct target slave name to allocateServerSocketPort","Validate with Utils.isEmpty( targetSlaveName ) before the call"],"exampleFix":"// before\nmap.allocateServerSocketPort( 40000, host, trans, src, null, \"stepA\", \"stepB\", \"0\", \"0\" );\n// after\nmap.allocateServerSocketPort( 40000, host, trans, src, targetSlave.getName(), \"stepA\", \"stepB\", \"0\", \"0\" );","handlingStrategy":"validation","validationCode":"if ( Utils.isEmpty( targetSlaveName ) ) {\n  throw new IllegalArgumentException( \"target slave name required\" );\n}","typeGuard":"boolean hasSlave(String s) { return s != null && !s.trim().isEmpty(); }","tryCatchPattern":"try {\n  map.allocateServerSocketPort( port, host, trans, src, tgtSlave, stepA, stepB, c1, c2 );\n} catch ( RuntimeException e ) {\n  if ( e.getMessage().contains( \"target slave\" ) ) {\n    // add the target slave to the cluster schema\n  }\n}","preventionTips":["Ensure all slaves referenced by hops exist in the cluster schema","Validate the topology after editing cluster definitions","Log the full cluster schema at execution start for debugging"],"tags":["java","kettle","carte","clustering"],"backgroundTag":"empty-required-field","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"}