apache/seatunnel · error · IllegalArgumentException

connector-jar-storage-mode must in [SHARED, ISOLATED]

Error message

connector-jar-storage-mode must in [SHARED, ISOLATED]

What it means

StorageStrategyFactory.of maps the connector-jar-storage-mode master config to a storage strategy implementation (SHARED or ISOLATED). Any other enum value reaches the default branch and throws IllegalArgumentException telling the mode must be SHARED or ISOLATED. Since the value is an enum this normally indicates config parsing inconsistency rather than user typo, but the message surfaces the allowed set.

Solutions

  1. Set connector-jar-storage-mode = SHARED (default) or ISOLATED in the master server config
  2. Align seatunnel-engine-server and seatunnel-engine-core jar versions so the enum matches
  3. Remove custom overrides of the storage-mode enum from the classpath
  4. If a new mode is needed, add a case to StorageStrategyFactory.of

Example fix

// before (config)
connector-jar-storage-mode = LOCAL
// after
connector-jar-storage-mode = SHARED
Defensive patterns

Strategy: validation

Validate before calling

String mode = config.get("connector-jar-storage-mode");
if (mode != null && !mode.equals("SHARED") && !mode.equals("ISOLATED")) throw new IllegalArgumentException("connector-jar-storage-mode must in [SHARED, ISOLATED]");

Type guard

boolean isValidStorageMode(ConnectorJarStorageMode m) { return m == ConnectorJarStorageMode.SHARED || m == ConnectorJarStorageMode.ISOLATED; }

Try / catch

try { server.start(); } catch (IllegalArgumentException e) { log.error("Fix connector-jar-storage-mode in config: {}", e.getMessage()); System.exit(1); }

Prevention

When it happens

Trigger: Master node starting with connector-jar-storage-mode resolving to an unexpected value — e.g. a custom/legacy enum constant or a manually constructed ConnectorJarStorageConfig with an invalid mode.

Common situations: Version mismatch between config parsing code and the factory (enum gained/lost a constant); hand-built configuration in tests; patched builds where the option allowed another value previously.

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/30206121c42e7ab6. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/service/jar/StorageStrategyFactory.java:41

import org.apache.seatunnel.engine.server.SeaTunnelServer;

public class StorageStrategyFactory {

    public StorageStrategyFactory() {}

    public static ConnectorJarStorageStrategy of(
            ConnectorJarStorageMode connectorJarStorageMode,
            ConnectorJarStorageConfig connectorJarStorageConfig,
            SeaTunnelServer seaTunnelServer) {
        switch (connectorJarStorageMode) {
            case SHARED:
                return new SharedConnectorJarStorageStrategy(
                        connectorJarStorageConfig, seaTunnelServer);
            case ISOLATED:
                return new IsolatedConnectorJarStorageStrategy(
                        connectorJarStorageConfig, seaTunnelServer);
            default:
                throw new IllegalArgumentException(
                        ServerConfigOptions.MasterServerConfigOptions.CONNECTOR_JAR_STORAGE_MODE
                                + " must in [SHARED, ISOLATED]");
        }
    }
}

View on GitHub (pinned to cf67b549a7)