{"record":{"id":"024a28a170ffc721","repo":"pentaho/pentaho-kettle","slug":"error-executing-transformation-and-error-cleaning-up-cluster","errorCode":null,"errorMessage":"Error executing transformation and error cleaning up cluster","messagePattern":"Error executing transformation and error cleaning up cluster","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"critical","filePath":"engine/src/main/java/org/pentaho/di/pan/executors/TransSplitterExecutionService.java","lineNumber":75,"sourceCode":"    } catch ( KettleException e ) {\n      cleanupClusterAfterError( extLog, transSplitter, e );\n    }\n  }\n\n  /**\n   * Cleans up the cluster in case of an error during execution.\n   *\n   * @param extLog the log channel interface for logging\n   * @param transSplitter the TransSplitter instance for splitting the transformation\n   * @param e the exception that occurred during execution\n   * @throws KettleException if an error occurs during cleanup\n   */\n  protected void cleanupClusterAfterError( LogChannelInterface extLog, TransSplitter transSplitter, Exception e ) throws KettleException {\n    // Clean up cluster in case of error\n    try {\n      Trans.cleanupCluster( extLog, transSplitter );\n    } catch ( Exception cleanupException ) {\n      throw new KettleException( \"Error executing transformation and error cleaning up cluster\", e );\n    }\n  }\n}\n","sourceCodeStart":57,"sourceCodeEnd":79,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/pan/executors/TransSplitterExecutionService.java#L57-L79","documentation":"cleanupClusterAfterError wraps a failed cluster cleanup: when the transformation execution already failed (e) and Trans.cleanupCluster also throws, this KettleException is thrown with the cleanup exception chained under the original execution exception. The message signals both the run and the abort/cleanup failed.","triggerScenarios":"executeClustered catches an execution error, calls cleanupClusterAfterError, and Trans.cleanupCluster itself throws (e.g. slave servers unreachable when trying to abort the clustered run).","commonSituations":"One or more slave servers in the cluster are down or network-partitioned; carte instances were stopped mid-run; authentication to slave servers fails during abort.","solutions":["Check the chained cause (getCause()) for the original transformation error first","Verify all slave servers defined for the cluster are reachable via their carte URLs","Inspect carte logs on each slave to find why the run and/or abort failed","Retry once slave connectivity is restored"],"exampleFix":"// before: ignoring which failure occurred\ncatch (KettleException e) { log(\"failed\"); }\n// after\ntry {\n  result = service.executeClustered(log, transMeta, split, config, args);\n} catch (KettleException e) {\n  log(\"Execution failed: \" + e.getCause()); // original trans error; cleanup error is chained\n}","handlingStrategy":"try-catch","validationCode":"// Pre-flight: verify every cluster slave is reachable before a clustered run\nfor (SlaveServer slave : transMeta.getClusterSchemas()...) {\n  if (!slave.getHostname().matches(\"[a-zA-Z0-9.-]+\")) throw new IllegalStateException(\"Bad slave host\");\n  // optionally: new Socket(slave.getHostname(), slave.getPort()).close();\n}","typeGuard":"static boolean slaveReachable(SlaveServer s) {\n  try (java.net.Socket sock = new java.net.Socket(s.getHostname(), s.getPort())) { return true; }\n  catch (Exception e) { return false; }\n}","tryCatchPattern":"try {\n  result = service.executeClustered(log, transMeta, splitter, cfg, args);\n} catch (KettleException e) {\n  Throwable trans = e.getCause() != null ? e.getCause() : e; // original transformation error\n  logError(\"Clustered run failed; cleanup also failed. Root: \" + trans.getMessage());\n  // investigate slave logs / network before retrying\n}","preventionTips":["Monitor slave server (carte) health before scheduled clustered runs","Keep carte logs aggregated for post-mortem","Use consistent credentials across master and slaves","Avoid network-reliant cleanup paths on flaky links — verify connectivity up front"],"tags":["cluster","pan","cleanup","exception-chaining"],"backgroundTag":"http-request-failed","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"}