apache/flink · error · IllegalArgumentException
%s is an unknown value of RestartStrategyType.
Error message
%s is an unknown value of RestartStrategyType.
What it means
Thrown by RestartStrategyType.of(String) when the supplied value does not match any accepted display value of the four restart strategy types (disable/none/off, fixed-delay, failure-rate, exponential-delay). The enum lookup iterates all available aliases before rejecting.
Source
Thrown at flink-core/src/main/java/org/apache/flink/configuration/RestartStrategyOptions.java:91
EXPONENTIAL_DELAY("exponential-delay", Sets.newHashSet("exponentialdelay"));
private final String mainValue;
private final Set<String> allAvailableValues;
RestartStrategyType(String mainValue, Set<String> otherAvailableValues) {
this.mainValue = mainValue;
this.allAvailableValues = Sets.newHashSet(mainValue);
allAvailableValues.addAll(otherAvailableValues);
}
/** Return the corresponding RestartStrategyType based on the displayed value. */
public static RestartStrategyType of(String value) {
for (RestartStrategyType restartStrategyType : RestartStrategyType.values()) {
if (restartStrategyType.getAllAvailableValues().contains(value)) {
return restartStrategyType;
}
}
throw new IllegalArgumentException(
String.format("%s is an unknown value of RestartStrategyType.", value));
}
public String getMainValue() {
return mainValue;
}
public Set<String> getAllAvailableValues() {
return allAvailableValues;
}
public TextElement[] getAllTextElement() {
return allAvailableValues.stream().map(TextElement::code).toArray(TextElement[]::new);
}
}
private static InlineElement[] concat(InlineElement[] first, InlineElement... second) {
InlineElement[] result = new InlineElement[first.length + second.length];View on GitHub (pinned to 2f3c205e92)
Solutions
- Use one of the exact accepted values: disable, none, off, fixed-delay, failure-rate, exponential-delay.
- Check for typos, extra spaces, or wrong casing (values are matched exactly, not case-insensitively).
- Consult RestartStrategyOptions.RestartStrategyType.getAllAvailableValues() for the authoritative list.
Example fix
# before restart-strategy.type: fixed delay # after restart-strategy.type: fixed-delay
Defensive patterns
Strategy: validation
Validate before calling
Set<String> valid = Set.of("disable", "none", "off", "fixed-delay", "failure-rate", "exponential-delay");
if (!valid.contains(value)) {
throw new IllegalArgumentException("Invalid restart strategy: " + value);
} Type guard
static boolean isValidRestartStrategy(String v) {
return Set.of("disable", "none", "off", "fixed-delay", "fixeddelay",
"failure-rate", "failurerate", "exponential-delay", "exponentialdelay").contains(v);
} Try / catch
try {
RestartStrategyType.of(value);
} catch (IllegalArgumentException e) {
if (e.getMessage().contains("unknown value of RestartStrategyType")) { /* fix value */ }
} Prevention
- Use the exact hyphenated strategy name (fixed-delay, not 'fixed delay').
- Validate the value against RestartStrategyType before setting it.
- Avoid deprecated key aliases that may behave differently.
When it happens
Trigger: Setting restart-strategy.type (or the deprecated restart-strategy key) to a misspelled or unsupported value in flink-conf.yaml or via -D. Values are matched exactly against the alias sets, so typos like 'fixed delay' (space) or 'fixeddelay-' fail.
Common situations: Using hyphens inconsistently (fixed-delay vs fixeddelay vs fixed delay). Copying a strategy name from old documentation. Using 'none' on a version that only accepts 'disable' (though aliases exist, exact match is required).
Related errors
- Value for config option %s must be one of %s (was %s)
- No cluster id was specified. Please specify a cluster to whi
- The configuration directory '{}', specified in the '{}' envi
- The configuration directory was not specified. Please specif
- No valid command-line found.
AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14).
Data as JSON: /api/errors/8222d951af105b86.
Report an issue: GitHub.