apache/seatunnel · error · IllegalArgumentException

Deploy mode not supported

Error message

Deploy mode ${deployMode} not supported

What it means

This error is thrown by SparkStarter.getInstance when the --deploy-mode argument parsed from the seatunnel.sh command line is neither 'cluster' nor 'client'. It is a guard against unsupported deploy-mode values for the Spark 2 starter; the fix is to pass -DdeployMode=cluster or client when submitting the job.

Solutions

  1. Set --deploy-mode to exactly 'cluster' or 'client'
  2. Check for casing/typo errors in scripts or CI pipelines invoking seatunnel.sh
  3. If you need other deploy modes, submit through native spark-submit with the generated SeaTunnel job package

Example fix

// before
sh bin/seatunnel.sh --deploy-mode cluser --config job.conf
// after
sh bin/seatunnel.sh --deploy-mode client --config job.conf
Defensive patterns

Strategy: validation

Validate before calling

String mode = System.getProperty("deployMode");
if (!"cluster".equals(mode) && !"client".equals(mode)) {
    throw new IllegalArgumentException("deploy-mode must be cluster or client: " + mode);
}

Try / catch

try {
    SparkStarter.getInstance(args, commandArgs);
} catch (IllegalArgumentException e) {
    log.error("Use --deploy-mode client|cluster", e);
}

Prevention

When it happens

Trigger: Submitting a Spark job with --deploy-mode (or env deploy-mode) set to something other than cluster or client, e.g. a typo like 'cluser' or a lowercase/uppercase mismatch.

Common situations: Typos in the deploy-mode flag; passing k8s-specific modes not supported by this starter; scripts injecting unexpected default values.

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/47a9ebabd2033509. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-core/seatunnel-spark-starter/seatunnel-spark-2-starter/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.SPARK2.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)