apache/seatunnel · error · IllegalArgumentException

must in [ALL, OFF, PART]

Error message

${TASK_EXECUTION_THREAD_SHARE_MODE} must in [ALL, OFF, PART]

What it means

When parsing the worker engine config, YamlSeaTunnelDomConfigProcessor validates that TASK_EXECUTION_THREAD_SHARE_MODE (upper-cased before the check) is one of ALL, OFF, or PART; anything else throws IllegalArgumentException because ThreadShareMode.valueOf would otherwise fail.

Solutions

  1. Set the value to exactly one of ALL, OFF, or PART (case-insensitive).
  2. Remove the key to use the default ThreadShareMode.
  3. Check the ServerConfigOptions.WorkerServerConfigOptions docs for accepted values in your version.

Example fix

# before
task-execution:
  thread-share-mode: TRUE
# after
task-execution:
  thread-share-mode: PART
Defensive patterns

Strategy: validation

Validate before calling

String mode = props.getProperty("task-execution.thread-share-mode", "").trim().toUpperCase(Locale.ROOT);
if (!mode.isEmpty() && !List.of("ALL", "OFF", "PART").contains(mode)) {
    throw new IllegalArgumentException("thread-share-mode must be ALL, OFF, or PART, got " + mode);
}

Try / catch

try {
    engineConfig.setTaskExecutionThreadShareMode(ThreadShareMode.valueOf(mode));
} catch (IllegalArgumentException e) {
    throw new ConfigValidationException("thread-share-mode must be ALL|OFF|PART", e);
}

Prevention

When it happens

Trigger: parseEngineConfig encounters the thread-share-mode key with a value outside {ALL, OFF, PART} (case-insensitive), e.g. 'true', 'shared', or a typo like 'ALLL'.

Common situations: Porting Flink/Spark thread settings into SeaTunnel YAML; typos in hand-written config; stale docs from older versions listing different enum names.

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/703ab5a13debaf38. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-engine/seatunnel-engine-common/src/main/java/org/apache/seatunnel/engine/common/config/YamlSeaTunnelDomConfigProcessor.java:203

                                        .JOB_METRICS_BACKUP_INTERVAL
                                        .key(),
                                getTextContent(node)));
            } else if (ServerConfigOptions.MasterServerConfigOptions.JOB_METRICS_PARTITION_COUNT
                    .key()
                    .equals(name)) {
                engineConfig.setJobMetricsPartitionCount(
                        getIntegerValue(
                                ServerConfigOptions.MasterServerConfigOptions
                                        .JOB_METRICS_PARTITION_COUNT
                                        .key(),
                                getTextContent(node)));
            } else if (ServerConfigOptions.WorkerServerConfigOptions
                    .TASK_EXECUTION_THREAD_SHARE_MODE
                    .key()
                    .equals(name)) {
                String mode = getTextContent(node).toUpperCase(Locale.ROOT);
                if (!Arrays.asList("ALL", "OFF", "PART").contains(mode)) {
                    throw new IllegalArgumentException(
                            ServerConfigOptions.WorkerServerConfigOptions
                                            .TASK_EXECUTION_THREAD_SHARE_MODE
                                    + " must in [ALL, OFF, PART]");
                }
                engineConfig.setTaskExecutionThreadShareMode(ThreadShareMode.valueOf(mode));
            } else if (ServerConfigOptions.WorkerServerConfigOptions.SLOT_SERVICE
                    .key()
                    .equals(name)) {
                engineConfig.setSlotServiceConfig(parseSlotServiceConfig(node));
            } else if (ServerConfigOptions.WorkerServerConfigOptions.TIMER_FLUSH_POOL_SIZE
                    .key()
                    .equals(name)) {
                engineConfig.setTimerFlushPoolSize(
                        getIntegerValue(
                                ServerConfigOptions.WorkerServerConfigOptions.TIMER_FLUSH_POOL_SIZE
                                        .key(),
                                getTextContent(node)));
            } else if (ServerConfigOptions.MasterServerConfigOptions.CHECKPOINT

View on GitHub (pinned to cf67b549a7)