{"record":{"id":"fee67e5c6f2723bf","repo":"pentaho/pentaho-kettle","slug":"error-executing-transformation-logging","errorCode":null,"errorMessage":"Error executing Transformation: \" + logging","messagePattern":"Error executing Transformation: \" \\+ logging","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/www/RunTransServlet.java","lineNumber":253,"sourceCode":"      trans.setSocketRepository( getSocketRepository() );\n\n      getTransformationMap().addTransformation( trans.getName(), carteObjectId, trans, transConfiguration );\n\n      // DO NOT disconnect from the shared repository connection when the job finishes.\n      //\n      String message = \"Transformation '\" + trans.getName() + \"' was added to the list with id \" + carteObjectId;\n      logBasic( message );\n\n      try {\n        // Execute the transformation...\n        //\n        trans.execute( null );\n\n        finishProcessing( trans, out );\n\n      } catch ( Exception executionException ) {\n        String logging = KettleLogStore.getAppender().getBuffer( trans.getLogChannelId(), false ).toString();\n        throw new KettleException( \"Error executing Transformation: \" + logging, executionException );\n      }\n    } catch ( Exception ex ) {\n      logError( \"Error occurred while executing transformation\", ex );\n      out.println( new WebResult( WebResult.STRING_ERROR, BaseMessages.getString(\n        PKG, \"RunTransServlet.Error.UnexpectedError\", Const.CR + Const.getStackTracker( ex ) ) ) );\n    }\n  }\n\n  //need for unit test\n  Trans createTrans( TransMeta transMeta, SimpleLoggingObject servletLoggingObject ) {\n    return new Trans( transMeta, servletLoggingObject );\n  }\n\n  private TransMeta loadTrans( Repository repository, String transformationName, VariableSpace parentVariableSpace ) throws KettleException {\n\n    if ( repository == null ) {\n      throw new KettleException( \"Repository required.\" );\n    } else {","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/www/RunTransServlet.java#L235-L271","documentation":"RunTransServlet.doGet wraps the actual transformation execution (trans.execute) in a try/catch and rethrows a KettleException whose message embeds the transformation's accumulated log buffer via KettleLogStore.getAppender().getBuffer(trans.getLogChannelId(), false). The original exception is chained as the cause, and the servlet also catches it one level out to return a WebResult error to the HTTP caller. It means 'the transformation failed to start or run', with the log text attached for diagnosis.","triggerScenarios":"Calling the Carte servlet GET /kettle/runTrans/ with a transName/repository that resolves, but Trans.execute(null) throws: e.g. transformation XML/repository content invalid, a step fails during init, missing parameters/variables required by the transformation, or database connections in the transformation cannot connect.","commonSituations":"CI/CD scripts or schedulers invoking Carte's runTrans REST endpoint; DB connection outage or wrong credentials inside the transformation; a variable like ${INTERNAL_VAR} or a named parameter left unset because the HTTP caller omitted it; Kettle environment/plugin jar missing on the Carte server.","solutions":["Read the chained cause and the log text in the message (the transformation's log buffer) to find the failing step; the message body itself contains the step-by-step log.","Verify all required transformation parameters and variables are passed (add &param=... to the servlet URL or set them in kettle.properties).","Test the transformation's DB connections directly from the Carte host (network/firewall, credentials).","Run the same transformation locally in Spoon to reproduce and see the full error dialog.","Ensure required Kettle plugins/jars are present in the Carte server's classpath."],"exampleFix":"// before: calling with no parameters\nGET http://carte:8080/kettle/runTrans/?trans=mytrans\n\n// after: pass required params and inspect log on failure\nGET http://carte:8080/kettle/runTrans/?trans=mytrans&rep=repo1&user=u&pass=p&param=DATE=2026-09-13","handlingStrategy":"try-catch","validationCode":"// before invoking the servlet, check required params exist\nif (!transParams.containsKey(\"trans\")) throw new IllegalArgumentException(\"trans is required\");\n// and test DB connectivity used by the ktr from the Carte host","typeGuard":null,"tryCatchPattern":"try {\n  String resp = callCarte(\"runTrans\", params);\n  if (!resp.contains(\"<result>OK</result>\")) throw new IllegalStateException(\"Trans failed: \" + extractLog(resp));\n} catch (Exception e) {\n  log.error(\"Transformation execution failed; message embeds the trans log\", e);\n}","preventionTips":["Always pass required transformation parameters and variables in the request.","Smoke-test the ktr in Spoon on an identical environment before automating.","Monitor Carte logs, not just HTTP status, since failures also return a WebResult error body."],"tags":["carte","transformation","execution-failed","rest-servlet","logging"],"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"}