apache/cassandra · error · IllegalArgumentException
Unsupported data storage unit: %s. Supported units are: %s
Error message
Unsupported data storage unit: %s. Supported units are: %s
What it means
DataStorageSpec parses storage values as number + unit symbol (B, KiB, MiB, GiB, TiB, PB etc.). fromSymbol throws this IllegalArgumentException when the unit suffix in the string does not match any known DataStorageUnit symbol, listing all supported symbols.
Source
Thrown at src/java/org/apache/cassandra/config/DataStorageSpec.java:648
assert (over > 0) && (over < (MAX-1L)) && (over == (MAX / m));
if (d > over)
return Long.MAX_VALUE;
return Math.multiplyExact(d, m);
}
/**
* @param symbol the unit symbol
* @return the memory unit corresponding to the given symbol
*/
public static DataStorageUnit fromSymbol(String symbol)
{
for (DataStorageUnit value : values())
{
if (value.symbol.equalsIgnoreCase(symbol))
return value;
}
throw new IllegalArgumentException(String.format("Unsupported data storage unit: %s. Supported units are: %s",
symbol, Arrays.stream(values())
.map(u -> u.symbol)
.collect(Collectors.joining(", "))));
}
static final long MAX = Long.MAX_VALUE;
/**
* The unit symbol
*/
private final String symbol;
DataStorageUnit(String symbol)
{
this.symbol = symbol;
}
public String getSymbol()View on GitHub (pinned to 88fd0f6a0e)
Solutions
- Use the exact supported symbols shown in the error message (e.g. KiB, MiB, GiB)
- Replace decimal-style units: MB -> MiB, KB -> KiB
- Fix typos in the unit suffix in cassandra.yaml
Example fix
// before (cassandra.yaml) commitlog_total_space_in_mb: 512MB // after commitlog_total_space: 512MiB
Defensive patterns
Strategy: validation
Validate before calling
String UNIT_RE = "^(B|KiB|MiB|GiB|TiB|PiB)$"; if (!unit.matches(UNIT_RE)) throw new IllegalArgumentException("unsupported unit: " + unit); Try / catch
try { DataStorageSpec.parse("512MiB"); } catch (IllegalArgumentException e) { /* show supported units from e.getMessage() */ } Prevention
- Use only Cassandra's binary unit symbols (KiB, MiB, GiB) not decimal (KB, MB)
- Copy unit spellings from the shipped cassandra.yaml examples
- Lint config files for unit suffixes before deploy
When it happens
Trigger: Parsing a config value like '100 MB' or '10 kilobytes' or '512kb' (case is handled, but the symbol must exist), or calling DataStorageSpec.DataStorageUnit.fromSymbol("KB") directly with an unrecognized symbol.
Common situations: Using decimal symbols (KB, MB) instead of the binary ones Cassandra expects (KiB, MiB), misspelling units (Mib, Gb), or copying configs from tools that use different unit conventions.
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
- Invalid data storage: ${value}. It shouldn't be more than ${
- Invalid data storage: value must be non-negative
- Invalid data storage: %d %s. It shouldn't be more than %d in
- Configured ${configName} "${intf}" could not be found
- Configured ${configName} "${intf}" was found, but had no add
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/0cfa2e6bdfe54a46.
Report an issue: GitHub.