apache/seatunnel · error · IllegalArgumentException

SeaTunnel job on flink engine deploy mode only support…

Error message

SeaTunnel job on flink engine deploy mode only support these options: [run, run-application]

What it means

IllegalArgumentException thrown by FlinkCommandArgs' DeployModeConverter.convert when the -d/--deploy-mode CLI argument is not one of the supported Flink deploy modes (run, run-application). The value must map to the DeployMode enum and be present in DEPLOY_MODE_TYPE_LIST.

Solutions

  1. Use --deploy-mode run or --deploy-mode run-application
  2. Check `--help` output for accepted deploy modes
  3. Remove the flag entirely if the default mode is acceptable

Example fix

# before
--deploy-mode cluster
# after
--deploy-mode run
Defensive patterns

Strategy: validation

Validate before calling

Set<String> allowed = Set.of("run", "run-application");
if (!allowed.contains(deployModeArg)) {
    throw new IllegalArgumentException("Unsupported --deploy-mode: " + deployModeArg);
}

Try / catch

try {
    args = FlinkCommandArgsBuilder.build(rawArgs);
} catch (IllegalArgumentException e) {
    System.err.println("Invalid --deploy-mode: " + e.getMessage());
}

Prevention

When it happens

Trigger: Running the Flink starter client with e.g. `--deploy-mode cluster` or `--deploy-mode client` — valid for Spark but not for this Flink converter — causing the membership check to fail after enum parsing.

Common situations: Reusing Spark client flags on the Flink client; typos like 'runapplication'; outdated scripts referencing removed modes.

Understand the failure class

Background: "Unknown argument", "Invalid value", and "must be one of": invalid CLI argument errors explained — this error's family across 35 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/114fcab1ac009215. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-core/seatunnel-flink-starter/seatunnel-flink-starter-common/src/main/java/org/apache/seatunnel/core/starter/flink/args/FlinkCommandArgs.java:132

            }
        }
    }

    public static class FlinkDeployModeConverter implements IStringConverter<DeployMode> {
        private static final List<DeployMode> DEPLOY_MODE_TYPE_LIST = new ArrayList<>();

        static {
            DEPLOY_MODE_TYPE_LIST.add(DeployMode.RUN);
            DEPLOY_MODE_TYPE_LIST.add(DeployMode.RUN_APPLICATION);
        }

        @Override
        public DeployMode convert(String value) {
            DeployMode deployMode = DeployMode.valueOf(value.toUpperCase().replaceAll("-", "_"));
            if (DEPLOY_MODE_TYPE_LIST.contains(deployMode)) {
                return deployMode;
            } else {
                throw new IllegalArgumentException(
                        "SeaTunnel job on flink engine deploy mode only "
                                + "support these options: [run, run-application]");
            }
        }
    }
}

View on GitHub (pinned to cf67b549a7)