apache/seatunnel · error · CommandExecuteException
Run SeaTunnel on spark failed
Error message
Run SeaTunnel on spark failed
What it means
SparkTaskExecuteCommand.execute wraps the whole Spark job execution (building SparkExecution and calling execute()) in a try/catch and rethrows any failure as CommandExecuteException with the generic message 'Run SeaTunnel on spark failed'. The original exception is attached as the cause, so the real error (bad config, connector failure, Spark startup problem) is in the stack trace below this message.
Solutions
- Read the 'Caused by' chain of the CommandExecuteException to find the root cause
- Verify the config file syntax and that all referenced plugins are installed (sh bin/install-plugin.sh)
- Run the job with a minimal batch config template to isolate environment vs config problems
- Check Spark master/cluster logs for submit-side failures
Defensive patterns
Strategy: try-catch
Validate before calling
// Verify config and plugins before submitting: // sh bin/seatunnel.sh --config job.conf -e local --dry-run static
Try / catch
try {
submitJob();
} catch (CommandExecuteException e) {
log.error("Spark job failed", e.getCause()); // root cause is in getCause()
} Prevention
- Always inspect the 'Caused by' chain, the message itself is generic
- Install all referenced connector plugins before running (install-plugin.sh)
- Validate config with --dry-run static before a real submission
When it happens
Trigger: Any Exception escaping new SparkExecution(config).execute(): invalid config file, missing connector jar, Spark session creation failure, job-level runtime errors in source/transform/sink. It is a wrapper, not a root cause.
Common situations: Config file references a connector not installed in $SEATUNNEL_HOME/connectors; Spark cannot initialize (wrong master/URL); a source table schema mismatch; checkpoint/savepoint restore failures.
Related errors
- SeaTunnel transform task
- All candidate sink tables were skipped in Spark starter.
- All candidate sink tables were skipped in Spark starter.
- API-09
- Deploy mode not supported
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/deac5ea8ac08be83.
Report an issue: GitHub.
Appendix: source
Thrown at seatunnel-core/seatunnel-spark-starter/seatunnel-spark-starter-common/src/main/java/org/apache/seatunnel/core/starter/spark/command/SparkTaskExecuteCommand.java:71
@Override
public void execute() throws CommandExecuteException {
Path configFile = resolveConfigPath(sparkCommandArgs, SparkFiles::get);
checkConfigExist(configFile);
Config config =
MetalakeConfigUtils.getMetalakeConfig(
ConfigBuilder.of(configFile, sparkCommandArgs.getVariables()));
if (!sparkCommandArgs.getJobName().equals(Constants.LOGO)) {
config =
config.withValue(
ConfigUtil.joinPath("env", "job.name"),
ConfigValueFactory.fromAnyRef(sparkCommandArgs.getJobName()));
}
try {
SparkExecution seaTunnelTaskExecution = new SparkExecution(config);
seaTunnelTaskExecution.execute();
} catch (Exception e) {
throw new CommandExecuteException("Run SeaTunnel on spark failed", e);
}
}
static Path resolveConfigPath(
SparkCommandArgs sparkCommandArgs, Function<String, String> sparkFilesResolver) {
Path configFile = FileUtils.getConfigPath(sparkCommandArgs);
if (!DeployMode.CLUSTER.equals(sparkCommandArgs.getDeployMode())) {
log.info("Resolved SeaTunnel config file: {}", configFile.toAbsolutePath());
return configFile;
}
Path fileName = configFile.getFileName();
if (fileName == null) {
log.info("Resolved SeaTunnel config file: {}", configFile.toAbsolutePath());
return configFile;
}
String sparkFilePath;View on GitHub (pinned to cf67b549a7)