apache/seatunnel · warning

set restart.strategy in config

Error message

set restart.strategy in config '{}' exception

What it means

This catch-all warning in EnvironmentUtil.setRestartStrategy fires when any exception is thrown while applying the restart strategy configuration (e.g. missing numeric sub-options, NumberFormatException from bad values, or wrong config types). The exception is logged with the full config object and swallowed, so the job continues with Flink's default restart behavior.

Solutions

  1. Add all required sub-options for the chosen strategy as plain numbers (milliseconds/counts).
  2. Check the logged stack trace under this warning to see the exact parse error.
  3. Validate the env block keys against the documented restart-strategy option names.

Example fix

// before
env {
  restart.strategy = "fixed-delay"
  restart.strategy.fixed-delay.delay = "10 s"
}
// after
env {
  restart.strategy = "fixed-delay"
  restart.strategy.fixed-delay.delay = 10000
  restart.strategy.fixed-delay.attempts = 3
}
Defensive patterns

Strategy: validation

Validate before calling

// ensure numeric sub-options parse before submission
long delay = config.getLong("restart.strategy.fixed-delay.delay");
int attempts = config.getInt("restart.strategy.fixed-delay.attempts");

Prevention

When it happens

Trigger: restart.strategy is a valid name but its sub-options are missing/malformed (e.g. restart.strategy.fixed-delay.delay not a number), or the Config object access throws while reading those keys.

Common situations: Forgetting required delay/interval fields when specifying fixed-delay or failure-rate; entering durations with unit suffixes ('10 s') where milliseconds are expected; config type mismatches after hand edits.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/962af3d6c4f6fb40. 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/utils/EnvironmentUtil.java:73

                    case "failure-rate":
                        long failureInterval =
                                config.getLong(ConfigKeyName.RESTART_FAILURE_INTERVAL);
                        int rate = config.getInt(ConfigKeyName.RESTART_FAILURE_RATE);
                        long delayInterval = config.getLong(ConfigKeyName.RESTART_DELAY_INTERVAL);
                        executionConfig.setRestartStrategy(
                                RestartStrategies.failureRateRestart(
                                        rate,
                                        Time.of(failureInterval, TimeUnit.MILLISECONDS),
                                        Time.of(delayInterval, TimeUnit.MILLISECONDS)));
                        break;
                    default:
                        log.warn(
                                "set restart.strategy failed, unknown restart.strategy [{}],only support no,fixed-delay,failure-rate",
                                restartStrategy);
                }
            }
        } catch (Exception e) {
            log.warn("set restart.strategy in config '{}' exception", config, e);
        }
    }

    public static CheckResult checkRestartStrategy(Config config) {
        if (hasPathAndWaring(config, ConfigKeyName.RESTART_STRATEGY)) {
            String restartStrategy = config.getString(ConfigKeyName.RESTART_STRATEGY);
            switch (restartStrategy.toLowerCase()) {
                case "fixed-delay":
                    if (!(config.hasPath(ConfigKeyName.RESTART_ATTEMPTS)
                            && config.hasPath(ConfigKeyName.RESTART_DELAY_BETWEEN_ATTEMPTS))) {
                        return CheckResult.error(
                                String.format(
                                        "fixed-delay restart strategy must set [%s],[%s]",
                                        ConfigKeyName.RESTART_ATTEMPTS,
                                        ConfigKeyName.RESTART_DELAY_BETWEEN_ATTEMPTS));
                    }
                    break;
                case "failure-rate":

View on GitHub (pinned to cf67b549a7)