apache/seatunnel · error · IllegalArgumentException

The %s mode is not supported.

Error message

The %s mode is not supported.

What it means

StartupConfig.getStartupOffset converts the configured CDC startup mode into an offset via the OffsetFactory. The switch only handles INITIAL, EARLIEST, LATEST, SPECIFIC and TIMESTAMP; any other StartupMode value reaches the default branch and throws IllegalArgumentException('The %s mode is not supported.').

Source

Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/config/StartupConfig.java:84

        switch (startupMode) {
            case EARLIEST:
                return offsetFactory.earliest();
            case LATEST:
                return offsetFactory.latest();
            case INITIAL:
            case SNAPSHOT_ONLY:
                return null;
            case COMMITTED_OFFSET:
                return offsetFactory.committedOffset();
            case SPECIFIC:
                if (specificOffset != null) {
                    return offsetFactory.specific(specificOffset);
                }
                return offsetFactory.specific(specificOffsetFile, specificOffsetPos);
            case TIMESTAMP:
                return offsetFactory.timestamp(timestamp);
            default:
                throw new IllegalArgumentException(
                        String.format("The %s mode is not supported.", startupMode));
        }
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Set startup.mode to one of the supported values: initial, earliest, latest, specific, or timestamp
  2. Align connector-cdc-base and the CDC connector module versions so the enum set matches
  3. Add the missing case to the switch if you maintain a fork
  4. Check config parsing isn't mapping your configured string to an unexpected enum

Example fix

// before
startup { mode = "custom-scan" }
// after
startup { mode = "latest" }
Defensive patterns

Strategy: validation

Validate before calling

if (startupMode != StartupMode.INITIAL && startupMode != StartupMode.EARLIEST
    && startupMode != StartupMode.LATEST && startupMode != StartupMode.SPECIFIC
    && startupMode != StartupMode.TIMESTAMP) {
    throw new IllegalArgumentException("unsupported startup mode: " + startupMode);
}

Type guard

boolean isSupportedStartupMode(StartupConfig.StartupMode m) {
    return EnumSet.of(StartupConfig.StartupMode.INITIAL, StartupConfig.StartupMode.EARLIEST,
        StartupConfig.StartupMode.LATEST, StartupConfig.StartupMode.SPECIFIC,
        StartupConfig.StartupMode.TIMESTAMP).contains(m);
}

Prevention

When it happens

Trigger: Calling getStartupOffset with a startup.mode that resolves to an enum constant not covered by the switch — typically a newly added StartupMode or a mis-mapped mode value from config parsing.

Common situations: Using a newer connector version that introduces a startup mode the local cdc-base doesn't handle; mixing connector-cdc-base versions with a connector expecting another mode; programmatic construction of StartupConfig with an exotic enum.

Related errors


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