apache/cassandra · error · IllegalArgumentException
Unexpected parameter
Error message
Unexpected parameter '%s', must be %s
What it means
FixedSplitTokenRangeSplitter.setParameter rejects any parameter key other than the constant NUMBER_OF_SUBRANGES with an IllegalArgumentException. This splitter supports exactly one configurable option.
Solutions
- Use only the 'number_of_subranges' key for FixedSplitTokenRangeSplitter
- Switch to RepairTokenRangeSplitter if bytes-based parameters are needed
- Correct the key spelling in the auto_repair config
- Use nodetool getautorepairconfig to see current valid parameters
Example fix
// before
splitter.setParameter("bytes_per_assignment", "1GB");
// after
splitter.setParameter("number_of_subranges", "10"); Defensive patterns
Strategy: validation
Validate before calling
if (!"number_of_subranges".equals(key))
throw new IllegalArgumentException("FixedSplitTokenRangeSplitter only accepts number_of_subranges"); Try / catch
try { splitter.setParameter(key, value); }
catch (IllegalArgumentException e) {
if (e.getMessage().startsWith("Unexpected parameter")) logger.warn("Invalid param {} for fixed splitter", key);
else throw e;
} Prevention
- Only send 'number_of_subranges' to FixedSplitTokenRangeSplitter
- Reserve bytes-based params for RepairTokenRangeSplitter
- Validate config keys against the splitter type before applying dynamic updates
When it happens
Trigger: Dynamically updating auto-repair config (nodetool setautorepairconfig / config reload) with a key the FixedSplit splitter doesn't recognize, e.g. bytes_per_assignment or a misspelled number_of_subranges.
Common situations: Copy-pasting bytes-based parameters intended for RepairTokenRangeSplitter onto FixedSplitTokenRangeSplitter; typos like number_of_subrange; stale config carrying obsolete keys.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- Unexpected parameter
- does not support custom configuration
- =' ' cannot be greater than =' ' for
- Unable to create instance of IAutoRepairTokenRangeSplitter
- a hints file cannot be configured for both compression and…
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/99c2887e3d3ad25e.
Report an issue: GitHub.
Appendix: source
Thrown at src/java/org/apache/cassandra/repair/autorepair/FixedSplitTokenRangeSplitter.java:142
for (String tableName : tableNames)
{
long totalBytes = repairPlan.getTableEstimatedBytes(AutoRepairUtils.getKeyspaceTableName(keyspaceName, tableName));
long bytesPerRange = Math.max(1, totalBytes / splitsPerRange);
for (Range<Token> splitRange : allRanges)
{
repairAssignments.add(new RepairAssignment(splitRange, keyspaceName, Collections.singletonList(tableName), bytesPerRange));
}
}
}
return new KeyspaceRepairAssignments(priority, keyspaceName, repairAssignments);
}
@Override
public void setParameter(String key, String value)
{
if (!key.equals(NUMBER_OF_SUBRANGES))
{
throw new IllegalArgumentException("Unexpected parameter '" + key + "', must be " + NUMBER_OF_SUBRANGES);
}
logger.info("Setting {} to {} for repair type {}", key, value, repairType);
this.numberOfSubranges = Integer.parseInt(value);
}
@Override
public Map<String, String> getParameters()
{
return Collections.singletonMap(NUMBER_OF_SUBRANGES, Integer.toString(numberOfSubranges));
}
}
View on GitHub (pinned to 88fd0f6a0e)