apache/flink · error · IllegalArgumentException

Unknown restart strategy {restartStrategyName}.

Error message

Unknown restart strategy {restartStrategyName}.

What it means

Thrown by RestartStrategyDescriptionUtils when resolving the human-readable description for a restart-strategy name that is not one of the recognized RestartStrategyType values (no, fixed-delay, failure-rate, exponential-delay). The lambda maps known types to descriptions and throws for anything else. It indicates the configuration or caller supplied an unrecognized restart strategy name.

Source

Thrown at flink-core/src/main/java/org/apache/flink/api/common/RestartStrategyDescriptionUtils.java:57

    public static String getRestartStrategyDescription(Configuration configuration) {
        final Optional<String> restartStrategyNameOptional =
                configuration.getOptional(RestartStrategyOptions.RESTART_STRATEGY);

        return restartStrategyNameOptional
                .map(
                        restartStrategyName -> {
                            switch (RestartStrategyOptions.RestartStrategyType.of(
                                    restartStrategyName.toLowerCase())) {
                                case NO_RESTART_STRATEGY:
                                    return "Restart deactivated.";
                                case FIXED_DELAY:
                                    return getFixedDelayDescription(configuration);
                                case FAILURE_RATE:
                                    return getFailureRateDescription(configuration);
                                case EXPONENTIAL_DELAY:
                                    return getExponentialDelayDescription(configuration);
                                default:
                                    throw new IllegalArgumentException(
                                            "Unknown restart strategy "
                                                    + restartStrategyName
                                                    + ".");
                            }
                        })
                .orElse("Cluster level default restart strategy");
    }

    private static String getExponentialDelayDescription(Configuration configuration) {
        Duration initialBackoff =
                configuration.get(
                        RestartStrategyOptions.RESTART_STRATEGY_EXPONENTIAL_DELAY_INITIAL_BACKOFF);
        Duration maxBackoff =
                configuration.get(
                        RestartStrategyOptions.RESTART_STRATEGY_EXPONENTIAL_DELAY_MAX_BACKOFF);
        double backoffMultiplier =
                configuration.get(
                        RestartStrategyOptions

View on GitHub (pinned to 2f3c205e92)

Solutions

  1. Use one of the documented names: no, fixed-delay, failure-rate, exponential-delay (case-insensitive).
  2. If relying on the cluster default, leave restart-strategy.name unset instead of passing an invalid value.
  3. Validate the configured name against RestartStrategyType.of(...) before asking for a description, surfacing a clear config error.

Example fix

// before
// restart-strategy.name: fixeddelay  (typo)
// after
# in flink-conf.yaml or job config
restart-strategy.name: fixed-delay
restart-strategy.fixed-delay.attempts: 3
Defensive patterns

Strategy: validation

Validate before calling

Set<String> valid = Set.of("no","fixed-delay","failure-rate","exponential-delay");
if (!valid.contains(restartStrategyName.toLowerCase())) {
    throw new IllegalArgumentException("Unknown restart strategy: " + restartStrategyName);
}

Type guard

public static boolean isKnownRestartStrategy(String name) {
    try { RestartStrategyOptions.RestartStrategyType.of(name.toLowerCase()); return true; }
    catch (Exception e) { return false; }
}

Prevention

When it happens

Trigger: Calling RestartStrategyDescriptionUtils.getRestartStrategyDescription with a name not matching any RestartStrategyType.of(...) case; setting restart-strategy.name to a typo or a removed strategy name.

Common situations: Config typo like 'fixed_deLay'; using a strategy name valid in an older Flink version that was removed; custom code building the description string from raw config without validation.

Related errors


AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14). Data as JSON: /api/errors/3f6fe3fc34fe4c62. Report an issue: GitHub.