{"record":{"id":"c20264c24dbc3491","repo":"pentaho/pentaho-kettle","slug":"variable-const-internal-variable-slave-server-name-is-not","errorCode":null,"errorMessage":"Variable '\" + Const.INTERNAL_VARIABLE_SLAVE_SERVER_NAME + \"' is not defined.","messagePattern":"Variable '\" \\+ Const\\.INTERNAL_VARIABLE_SLAVE_SERVER_NAME \\+ \"' is not defined\\.","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/step/BaseStep.java","lineNumber":2074,"sourceCode":"   *\n   * @throws KettleStepException if there is an error opening socket connections to the remote output steps\n   */\n  protected void openRemoteOutputStepSocketsOnce() throws KettleStepException {\n    if ( remoteOutputSteps.isEmpty()\n      || remoteOutputStepsInitialized\n      || stepMeta.isMappingOutput() ) { // PDI-20183 MappingOutput is configured in the Mapping step\n\n      return;\n    }\n\n    outputRowSetsLock.writeLock().lock();\n    try {\n      // Set the current slave target name on all the current output steps (local)\n      //\n      for ( RowSet rowSet : outputRowSets ) {\n        rowSet.setRemoteSlaveServerName( getVariable( Const.INTERNAL_VARIABLE_SLAVE_SERVER_NAME ) );\n        if ( getVariable( Const.INTERNAL_VARIABLE_SLAVE_SERVER_NAME ) == null ) {\n          throw new KettleStepException( \"Variable '\"\n            + Const.INTERNAL_VARIABLE_SLAVE_SERVER_NAME + \"' is not defined.\" );\n        }\n      }\n\n      // Start threads: one per remote step to funnel the data through...\n      //\n      for ( RemoteStep remoteStep : remoteOutputSteps ) {\n        try {\n          if ( remoteStep.getTargetSlaveServerName() == null ) {\n            throw new KettleStepException(\n              \"The target slave server name is not defined for remote output step: \" + remoteStep );\n          }\n          BlockingRowSet rowSet = remoteStep.openWriterSocket();\n          if ( log.isDetailed() ) {\n            logDetailed( BaseMessages.getString( PKG, \"BaseStep.Log.OpenedWriterSocketToRemoteStep\", remoteStep ) );\n          }\n          outputRowSets.add( rowSet );\n        } catch ( IOException e ) {","sourceCodeStart":2056,"sourceCodeEnd":2092,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/step/BaseStep.java#L2056-L2092","documentation":"Before starting remote output threads, BaseStep sets each output rowset's remote slave name from the internal variable Const.INTERNAL_VARIABLE_SLAVE_SERVER_NAME (Internal.Slave.Server.Name). If that variable is null, a KettleStepException declaring the variable undefined is thrown. This internal variable must be set by the clustered-execution framework; its absence means the step is running outside a properly initialized clustered context.","triggerScenarios":"A remote-output (clustered) step executes where the internal slave server name variable was never set — e.g. running the transformation directly instead of through the cluster runtime, or a Kettle version where the variable was not initialized before putRow/startThreads.","commonSituations":"Running a clustered transformation locally without a slave server context; older/newer Pentaho versions changing internal variable initialization; executing a step copied from a clustered transformation in a standalone transformation.","solutions":["Run the transformation via the proper clustered execution path (SlaveServer/TransExecutionConfiguration) so internal variables get set.","Set the variable explicitly before execution: setVariable(Const.INTERNAL_VARIABLE_SLAVE_SERVER_NAME, slaveName) on the transformation.","Remove remote output step configuration if the transformation is meant to run standalone.","Guard code that calls putRow on such steps with a check that the variable is defined."],"exampleFix":"// before: standalone run of a clustered transformation\nTrans trans = new Trans(transMeta);\ntrans.execute(null);\n\n// after: define the internal variable or use cluster config\ntrans.setVariable(Const.INTERNAL_VARIABLE_SLAVE_SERVER_NAME, \"my-slave\");\ntrans.execute(null);","handlingStrategy":"validation","validationCode":"String slaveName = trans.getVariable(Const.INTERNAL_VARIABLE_SLAVE_SERVER_NAME);\nif (slaveName == null && transMeta.hasRemoteOutputSteps()) {\n  throw new IllegalStateException(\"Internal.Slave.Server.Name variable is not set\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  putRow(rowMeta, row);\n} catch (KettleStepException e) {\n  if (e.getMessage().contains(\"INTERNAL_VARIABLE_SLAVE_SERVER_NAME\") ||\n      e.getMessage().contains(\"Internal.Slave.Server.Name\")) {\n    logError(\"Slave server variable missing; not a clustered run\", e);\n  } else { throw e; }\n}","preventionTips":["Execute clustered transformations only through the cluster runtime","Set internal variables explicitly when running programmatically","Strip remote-output config from transformations used standalone"],"tags":["cluster","variables","configuration"],"backgroundTag":"missing-env-var","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"}