apache/cassandra · error · ConfigurationException
is not a valid number between 0 and 1
Error message
%s is not a valid number between 0 and 1: %s
What it means
The unified compaction controller validates the 'sstable_growth' option by parsing it with FBUtilities.parsePercent. If the string is not a valid number/percentage at all (e.g. 'high', '0,5'), the resulting NumberFormatException is rethrown as a ConfigurationException identifying the option.
Solutions
- Set sstable_growth to a valid numeric value between 0 and 1, e.g. '0.3' or '30%'.
- Use a dot as the decimal separator, not a comma.
- Remove the option to fall back to the default.
- Inspect the cause's message (e.getMessage()) for the exact parse failure.
Example fix
// before
compaction = {'class': 'UnifiedCompactionStrategy', 'sstable_growth': '0,3'};
// after
compaction = {'class': 'UnifiedCompactionStrategy', 'sstable_growth': '0.3'}; Defensive patterns
Strategy: validation
Validate before calling
String v = options.get("sstable_growth");
if (v != null) {
try { Double.parseDouble(v.replace("%", "")); }
catch (NumberFormatException e) { throw new IllegalArgumentException("sstable_growth must be numeric: " + v); }
} Try / catch
try { strategy.validateOptions(opts); } catch (ConfigurationException e) { logger.error("Unparseable sstable_growth: {}", e.getMessage()); } Prevention
- Always use '.' as decimal separator in configs
- Quote and escape values in generated CQL
- Unit-test config generators with strict parsers
When it happens
Trigger: Calling validateOptions with an sstable_growth value that cannot be parsed as a number or percentage, such as 'fast' or '0,5' with a comma decimal separator.
Common situations: Free-text config values, comma-vs-dot decimal locale mistakes, truncation by templating tools, or editing the option by hand.
Understand the failure class
Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.
Related errors
- concurrent_compactors should be strictly greater than 0…
- Could not set new local compaction strategy
- Disabling compaction by setting compaction thresholds to 0…
- Fan factor cannot be lower than 2 in
- Invalid configuration
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/4e61c173090bd873.
Report an issue: GitHub.
Appendix: source
Thrown at src/java/org/apache/cassandra/db/compaction/unified/Controller.java:662
}
}
s = options.remove(SSTABLE_GROWTH_OPTION);
if (s != null)
{
try
{
double targetSSTableGrowth = FBUtilities.parsePercent(s);
if (targetSSTableGrowth < 0 || targetSSTableGrowth > 1)
{
throw new ConfigurationException(String.format("%s %s must be between 0 and 1",
SSTABLE_GROWTH_OPTION,
s));
}
}
catch (NumberFormatException e)
{
throw new ConfigurationException(String.format("%s is not a valid number between 0 and 1: %s",
SSTABLE_GROWTH_OPTION,
e.getMessage()),
e);
}
}
return options;
}
private static void validateBoolean(Map<String, String> options, String option)
{
String s;
s = options.remove(option);
if (s != null && !s.equalsIgnoreCase("true") && !s.equalsIgnoreCase("false")) {
throw new ConfigurationException(String.format("%s should either be 'true' or 'false', not %s",
option, s));
}
}View on GitHub (pinned to 88fd0f6a0e)