apache/seatunnel · warning
set restart.strategy failed, unknown restart.strategy
Error message
set restart.strategy failed, unknown restart.strategy [{}],only support no,fixed-delay,failure-rate What it means
EnvironmentUtil.setRestartStrategy applies the 'restart.strategy' env option to the Flink ExecutionEnvironment. When the strategy name is not 'no', 'fixed-delay', or 'failure-rate' (case-sensitive), it logs this warning and leaves Flink's default restart strategy unchanged. The whole call is also wrapped in a try/catch that swallows other errors.
Solutions
- Set restart.strategy to exactly 'no', 'fixed-delay', or 'failure-rate'.
- Provide the matching sub-options (e.g. fixed-delay delay/attempts, failure-rate thresholds) so the strategy actually applies.
- Remove the key to keep Flink's default restart strategy.
Example fix
// before
env {
restart.strategy = "fixed_delay"
}
// after
env {
restart.strategy = "fixed-delay"
restart.strategy.fixed-delay.attempts = 3
restart.strategy.fixed-delay.delay = 10000
} Defensive patterns
Strategy: validation
Validate before calling
String rs = config.getString("restart.strategy");
if (!java.util.Arrays.asList("no","fixed-delay","failure-rate").contains(rs)) {
throw new IllegalArgumentException("restart.strategy must be no, fixed-delay, or failure-rate");
} Prevention
- Follow documented strategy names exactly (lowercase, hyphenated).
- Include required sub-options for fixed-delay/failure-rate.
- Lint env blocks in CI against allowed keys/values.
When it happens
Trigger: env block sets restart.strategy to an unknown value such as 'fixed_delay', 'none', 'FixedDelay', or 'exponential-delay'; called during environment setup for Flink batch/stream jobs.
Common situations: Copying Flink YAML-style restart strategy names with different casing/underscores; configs migrated from other engines; users expecting newer Flink strategies (e.g. exponential-delay) unsupported by this mapping.
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
- set restart.strategy in config
- set checkpoint.mode failed, unknown checkpoint.mode
- set time-characteristic failed, unknown time-characteristic
- accessId and accesskey must be provided when sts_token is…
- Agent config is not a readable file
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/deae587c230cb397.
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:67
case "fixed-delay":
int attempts = config.getInt(ConfigKeyName.RESTART_ATTEMPTS);
long delay = config.getLong(ConfigKeyName.RESTART_DELAY_BETWEEN_ATTEMPTS);
executionConfig.setRestartStrategy(
RestartStrategies.fixedDelayRestart(attempts, delay));
break;
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(View on GitHub (pinned to cf67b549a7)