{"record":{"id":"a165ce43f5f8fac8","repo":"pentaho/pentaho-kettle","slug":"there-was-an-error-preparing-the-transformation-for-excution","errorCode":null,"errorMessage":"There was an error preparing the transformation for excution on the remote server: ","messagePattern":"There was an error preparing the transformation for excution on the remote server: ","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/Trans.java","lineNumber":4406,"sourceCode":"        //\n        String xml = new TransConfiguration( transMeta, executionConfiguration ).getXML();\n        String reply = slaveServer.sendXML( xml, RegisterTransServlet.CONTEXT_PATH + \"/?xml=Y\" );\n        WebResult webResult = WebResult.fromXMLString( reply );\n        if ( !webResult.getResult().equalsIgnoreCase( WebResult.STRING_OK ) ) {\n          throw new KettleException( \"There was an error posting the transformation on the remote server: \" + Const.CR\n            + webResult.getMessage() );\n        }\n        carteObjectId = webResult.getId();\n      }\n\n      // Prepare the transformation\n      //\n      String reply =\n        slaveServer.execService( PrepareExecutionTransServlet.CONTEXT_PATH + \"/?name=\" + URLEncoder.encode( transMeta\n          .getName(), \"UTF-8\" ) + \"&xml=Y&id=\" + carteObjectId );\n      WebResult webResult = WebResult.fromXMLString( reply );\n      if ( !webResult.getResult().equalsIgnoreCase( WebResult.STRING_OK ) ) {\n        throw new KettleException( \"There was an error preparing the transformation for excution on the remote server: \"\n          + Const.CR + webResult.getMessage() );\n      }\n\n      // Start the transformation\n      //\n      reply =\n        slaveServer.execService( StartExecutionTransServlet.CONTEXT_PATH + \"/?name=\" + URLEncoder.encode( transMeta\n          .getName(), \"UTF-8\" ) + \"&xml=Y&id=\" + carteObjectId );\n      webResult = WebResult.fromXMLString( reply );\n\n      if ( !webResult.getResult().equalsIgnoreCase( WebResult.STRING_OK ) ) {\n        throw new KettleException( \"There was an error starting the transformation on the remote server: \" + Const.CR\n          + webResult.getMessage() );\n      }\n\n      return carteObjectId;\n    } catch ( KettleException ke ) {\n      throw ke;","sourceCodeStart":4388,"sourceCodeEnd":4424,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/Trans.java#L4388-L4424","documentation":"Thrown by Trans when preparing a transformation for clustered/remote execution: the slave server was asked (via PrepareExecutionTransServlet over Carte) to prepare the transformation and its WebResult reported a non-OK result. The remote side failed during prepareExecutionTrans, and the remote message is appended after Const.CR. It means the transformation XML was delivered but the remote node could not stage it for execution.","triggerScenarios":"Calling Trans.executeProgged/clustered run path that calls slaveServer.execService(PrepareExecutionTransServlet.CONTEXT_PATH + ...) where webResult.getResult() != STRING_OK.","commonSituations":"Remote Carte slave missing step/plugin jars referenced by the trans; transformation name mismatch or transMeta name not registered remotely; slave-side variable/DB connection resolution failures; corrupted XML round-trip via the servlet.","solutions":["Read the appended webResult.getMessage() (and the slave's carte.log) to see the remote cause","Verify the slave has all required plugins/steps installed (KETTLE_PLUGIN_PACKAGES / plugins dir)","Confirm the transformation name and carteObjectId match what was registered on the slave","Check slave DB connections, variables, and metastore availability on the remote node","Upgrade both master and slave to matching Pentaho/Kettle versions"],"exampleFix":"// before: blind clustered execution\ntrans.executeClustered(clusterMeta, executionConfiguration);\n// after: pre-check slave connectivity and log the remote message\ntry {\n  trans.executeClustered(clusterMeta, executionConfiguration);\n} catch (KettleException e) {\n  logError(\"Remote prepare failed: \" + e.getMessage()); // includes slave webResult message\n}","handlingStrategy":"try-catch","validationCode":"if (slaveServer.getHostname() == null || slaveServer.getHostname().isEmpty()) throw new KettleException(\"No slave hostname configured\");\nSlaveServerStatus status = slaveServer.getStatus();","typeGuard":"boolean isSlaveReachable(SlaveServer s) { try { return s.getStatus() != null; } catch (Exception e) { return false; } }","tryCatchPattern":"try { trans.executeClustered(clusterMeta, execConfig); } catch (KettleException e) { log.error(\"Remote prepare failed, slave message: \" + e.getMessage(), e); /* inspect carte.log on slave */ }","preventionTips":["Keep master and slave plugin directories in sync","Check slave /kettle/status/ before cluster runs","Monitor slave carte.log during cluster executions"],"tags":["kettle","clustered-execution","remote-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"}