{"record":{"id":"3c9cd4ae0e0ea01f","repo":"pentaho/pentaho-kettle","slug":"an-error-occurred-while-starting-the-execution-of-a-slave","errorCode":null,"errorMessage":"An error occurred while starting the execution of a slave transformation: ","messagePattern":"An error occurred while starting the execution of a slave transformation: ","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/Trans.java","lineNumber":3951,"sourceCode":"                master.getName(), \"UTF-8\" ) + \"&id=\" + URLEncoder.encode( carteObjectId, \"UTF-8\" ) + \"&xml=Y\" );\n            WebResult webResult = WebResult.fromXMLString( masterReply );\n            if ( !webResult.getResult().equalsIgnoreCase( WebResult.STRING_OK ) ) {\n              throw new KettleException( \"An error occurred while starting the execution of the master transformation: \"\n                + webResult.getMessage() );\n            }\n          }\n\n          // Start the slaves\n          // WG: Should these be threaded like the above initialization?\n          for ( int i = 0; i < slaves.length; i++ ) {\n            TransMeta slaveTrans = transSplitter.getSlaveTransMap().get( slaves[ i ] );\n            String carteObjectId = carteObjectMap.get( slaveTrans );\n            String slaveReply =\n              slaves[ i ].execService( StartExecutionTransServlet.CONTEXT_PATH + \"/?name=\" + URLEncoder.encode(\n                slaveTrans.getName(), \"UTF-8\" ) + \"&id=\" + URLEncoder.encode( carteObjectId, \"UTF-8\" ) + \"&xml=Y\" );\n            WebResult webResult = WebResult.fromXMLString( slaveReply );\n            if ( !webResult.getResult().equalsIgnoreCase( WebResult.STRING_OK ) ) {\n              throw new KettleException( \"An error occurred while starting the execution of a slave transformation: \"\n                + webResult.getMessage() );\n            }\n          }\n        }\n      }\n    } catch ( KettleException ke ) {\n      throw ke;\n    } catch ( Exception e ) {\n      throw new KettleException( \"There was an error during transformation split\", e );\n    }\n  }\n\n  /**\n   * Monitors a clustered transformation every second, after all the transformations in a cluster schema are running.\n   * <br>\n   * Now we should verify that they are all running as they should.<br>\n   * If a transformation has an error, we should kill them all.<br>\n   * This should happen in a separate thread to prevent blocking of the UI.<br>","sourceCodeStart":3933,"sourceCodeEnd":3969,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/Trans.java#L3933-L3969","documentation":"Thrown by Trans.prepareExecution(String[]) in the clustered path: after the master started, each slave is started via StartExecutionTransServlet, and a slave replied with a non-OK WebResult. The slave's own error message is appended to this wrapper exception.","triggerScenarios":"Executing a clustered transformation where a slave's start-execution servlet call returns an error WebResult because the slave slice failed to start (e.g. step init failed, resource unavailable, transformation not found under the given carte id).","commonSituations":"Slave lost its prepared transformation (Carte restarted between prepare and start); slave cannot connect to its database; master/slave network partition after prepare; concurrent cleanup removed the transformation before start.","solutions":["Check the appended webResult.getMessage() and the failing slave's carte.log for the start failure.","Verify the slave's Carte instance was not restarted between prepare and start phases; re-run the whole cluster execution if it was.","Confirm slave database connections and variables are valid and reachable.","Ensure network stability between master and slaves during execution (timeouts, firewall).","Keep master and slave Kettle/plugin versions in sync to avoid start-time incompatibilities."],"exampleFix":"// before: restarting Carte on slaves mid-run causes start failures\n// operationally: keep slaves up; then re-run\ntrans.prepareExecution(new String[0]);\ntrans.startThreads();\n// after: guard with a pre-check that all slaves are alive\nfor (SlaveServer s : clusterSchema.findSlaveServers()) {\n  if (!s.getSlaveStatus().getStatusDescription().contains(\"OK\")) throw new KettleException(\"Slave down: \" + s);\n}","handlingStrategy":"try-catch","validationCode":"// ensure all slaves are alive and registered right before start\nfor (SlaveServer s : clusterSchema.getSlaveServers()) {\n  if (s.getSlaveStatus() == null) throw new KettleException(\"Slave down: \" + s.getName());\n}","typeGuard":null,"tryCatchPattern":"try {\n  trans.prepareExecution(new String[0]);\n  trans.startThreads();\n} catch (KettleException e) {\n  if (e.getMessage().contains(\"starting the execution of a slave\")) {\n    log.error(\"Slave start failed: \" + e.getMessage(), e);\n    // re-run the entire clustered execution (prepare+start must be consistent)\n  } else throw e;\n}","preventionTips":["Do not restart slave Carte instances between prepare and start.","Avoid concurrent cleanup during a running cluster.","Keep network sessions stable; increase timeouts if slaves are slow.","Sync Kettle/plugin versions across all nodes."],"tags":["kettle","clustered-transformation","slave-server","carte"],"backgroundTag":"http-error-response","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"}