apache/cassandra · error · ConfigurationException
%s %s is out of range of Long.
Error message
%s %s is out of range of Long.
What it means
Controller.validateOptions parses target_sstable_size using FBUtilities.parseHumanReadable and requires it to fit in a signed long (bytes). Values of Long.MAX_VALUE bytes or larger throw ConfigurationException reporting the option and raw string; below the minimum threshold triggers a different error.
Source
Thrown at src/java/org/apache/cassandra/db/compaction/unified/Controller.java:523
}
catch (NumberFormatException e)
{
throw new ConfigurationException(String.format("%s is not a parsable int (base10) for %s",
s,
BASE_SHARD_COUNT_OPTION), e);
}
}
// preserve the configuration for later use during min_sstable_size.
long targetSSTableSize = DEFAULT_TARGET_SSTABLE_SIZE;
s = options.remove(TARGET_SSTABLE_SIZE_OPTION);
if (s != null)
{
try
{
double targetSize = FBUtilities.parseHumanReadable(s, null, "B");
if (targetSize >= Long.MAX_VALUE) {
throw new ConfigurationException(String.format("%s %s is out of range of Long.",
TARGET_SSTABLE_SIZE_OPTION,
s));
}
if (targetSize < MIN_TARGET_SSTABLE_SIZE)
{
throw new ConfigurationException(String.format("%s %s is not acceptable, size must be at least %s",
TARGET_SSTABLE_SIZE_OPTION,
s,
FBUtilities.prettyPrintMemory(MIN_TARGET_SSTABLE_SIZE)));
}
targetSSTableSize = (long) Math.ceil(targetSize);
}
catch (NumberFormatException e)
{
throw new ConfigurationException(String.format("%s %s is not a valid size in bytes: %s",
TARGET_SSTABLE_SIZE_OPTION,
s,
e.getMessage()),View on GitHub (pinned to 88fd0f6a0e)
Solutions
- Set target_sstable_size to a realistic size like '100MiB' or '1GiB' (well below 2^63 bytes)
- Sanitize size inputs to sane upper bounds in tooling
- Remove the option to use the default
- Catch ConfigurationException around table option validation
Example fix
// before 'target_sstable_size': '10000000000GiB' // after 'target_sstable_size': '1GiB'
Defensive patterns
Strategy: validation
Validate before calling
if (opts.containsKey("target_sstable_size")) {
double bytes = FBUtilities.parseHumanReadable(opts.get("target_sstable_size"), null, "B");
if (bytes >= Long.MAX_VALUE) throw new IllegalArgumentException("target_sstable_size exceeds Long range");
if (bytes < FBUtilities.parseHumanReadable("50MiB", null, "B")) throw new IllegalArgumentException("target_sstable_size too small");
} Try / catch
try {
session.execute(alterStmt);
} catch (RuntimeException e) {
if (e.getMessage().contains("out of range of Long")) { /* reduce the size value */ }
throw e;
} Prevention
- Use sane human-readable sizes like '100MiB'–'1GiB'
- Check for runaway zero-padding or unit multipliers in generated configs
- Pre-parse sizes with FBUtilities.parseHumanReadable in tooling before applying
When it happens
Trigger: validateOptions with target_sstable_size set to an enormous human-readable value such as '10000000GiB' or '9223372036854775807B' or larger, so the parsed double >= Long.MAX_VALUE.
Common situations: Misplaced decimal point or repeated zeros in size strings; unit confusion (GB vs GiB) producing enormous byte counts; scripting that multiplies sizes without bounds checks.
Understand the failure class
Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.
Related errors
- Scaling parameter %s must match %s
- Fan factor cannot be lower than 2 in %s
- Invalid configuration, %s should be positive: %d
- %s is not a parsable int (base10) for %s
- concurrent_compactors should be strictly greater than 0, but
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/15c03f731b9d2893.
Report an issue: GitHub.