apache/seatunnel · error · IllegalArgumentException

Deploy mode not supported

Error message

Deploy mode ${deployMode} not supported

What it means

The common SparkStarter.getInstance (spark-starter-common) chooses between ClusterModeSparkStarter and ClientModeSparkStarter based on deploy mode; any other deploy-mode value throws an IllegalArgumentException 'Deploy mode <x> not supported'.

Solutions

  1. Set deploy-mode to exactly 'cluster' or 'client'
  2. Check invoking scripts/CI for the value actually passed
  3. Use spark-submit directly for deploy modes the starter doesn't support

Example fix

// before
sh bin/seatunnel.sh --deploy-mode local --config job.conf
// after
sh bin/seatunnel.sh --deploy-mode cluster --config job.conf
Defensive patterns

Strategy: validation

Validate before calling

String mode = commandArgs.getDeployMode();
if (!"cluster".equals(mode) && !"client".equals(mode)) {
    throw new IllegalArgumentException("Unsupported deploy mode: " + mode);
}

Try / catch

try {
    SparkStarter.getInstance(args, commandArgs);
} catch (IllegalArgumentException e) {
    log.error("Valid deploy modes: cluster, client", e);
}

Prevention

When it happens

Trigger: Spark job submission with a deploy-mode value outside {cluster, client}, such as a typo, wrong case, or an unsupported value passed via command args.

Common situations: Typo in --deploy-mode in launch scripts; Kubernetes deploy modes passed to the standard starter; automation tools injecting defaults like 'local'.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/2582a4a6caed0dba. 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/SparkStarter.java:104

    /**
     * method to get SparkStarter instance, will return {@link ClusterModeSparkStarter} or {@link
     * ClientModeSparkStarter} depending on deploy mode.
     */
    static SparkStarter getInstance(String[] args) {
        SparkCommandArgs commandArgs =
                CommandLineUtils.parse(
                        args,
                        new SparkCommandArgs(),
                        EngineType.SPARK3.getStarterShellName(),
                        true);
        DeployMode deployMode = commandArgs.getDeployMode();
        switch (deployMode) {
            case CLUSTER:
                return new ClusterModeSparkStarter(args, commandArgs);
            case CLIENT:
                return new ClientModeSparkStarter(args, commandArgs);
            default:
                throw new IllegalArgumentException("Deploy mode " + deployMode + " not supported");
        }
    }

    @Override
    public List<String> buildCommands() throws IOException {
        setSparkConf();
        Common.setDeployMode(commandArgs.getDeployMode());
        Common.setStarter(true);
        this.jars.addAll(Common.getLibJars());
        this.jars.addAll(getConnectorJarDependencies());
        this.jars.addAll(
                new ArrayList<>(
                        Common.getThirdPartyJars(
                                sparkConf.getOrDefault(EnvCommonOptions.JARS.key(), ""))));
        // TODO: override job name in command args, because in spark cluster deploy mode
        // command-line arguments are read first
        // if user has not specified job with command line, the job name config in file will not
        // work

View on GitHub (pinned to cf67b549a7)