apache/cassandra · error · IllegalArgumentException
Unexpected parameter
Error message
Unexpected parameter '%s', must be one of %s
What it means
RepairTokenRangeSplitter.setParameter validates the key against the PARAMETERS set and throws IllegalArgumentException listing all accepted keys when the key is unknown. After validation it records the value and re-runs reinitParameters.
Solutions
- Use only keys in the splitter's PARAMETERS set (bytes_per_assignment, max_bytes_per_schedule, ...)
- Read the accepted list printed in the error message
- Run nodetool getautorepairconfig to see current valid configuration
- Fix spelling and re-apply the update
Example fix
// before
splitter.setParameter("bytes_per_assigment", "1GB");
// after
splitter.setParameter("bytes_per_assignment", "1GB"); Defensive patterns
Strategy: validation
Validate before calling
Set<String> ALLOWED = Set.of("bytes_per_assignment","max_bytes_per_schedule");
if (!ALLOWED.contains(key))
throw new IllegalArgumentException("Key " + key + " not in " + ALLOWED); Try / catch
try { splitter.setParameter(key, value); }
catch (IllegalArgumentException e) {
if (e.getMessage().startsWith("Unexpected parameter"))
logger.warn("Unknown auto-repair param {}; accepted list: {}", key, e.getMessage());
else throw e;
} Prevention
- Copy parameter names exactly from the error's accepted list
- Don't reuse FixedSplit keys on RepairTokenRangeSplitter
- Validate config keys against PARAMETERS before dynamic updates
When it happens
Trigger: Dynamic auto-repair config update with a key not in PARAMETERS (e.g. typo like bytes_per_assigment, or a FixedSplit-only key such as number_of_subranges).
Common situations: Typos in nodetool setautorepairconfig or cassandra.yaml; copying keys between the two splitter implementations; older config keys removed after upgrade.
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/f84fd64399dd954c.
Report an issue: GitHub.
Appendix: source
Thrown at src/java/org/apache/cassandra/repair/autorepair/RepairTokenRangeSplitter.java:625
Iterable<SSTableReader> sstables = cfs.getTracker().getView().select(SSTableSet.CANONICAL);
SSTableIntervalTree tree = SSTableIntervalTree.buildSSTableIntervalTree(ImmutableList.copyOf(sstables));
Range<PartitionPosition> r = Range.makeRowRange(tokenRange);
List<SSTableReader> canonicalSSTables = View.sstablesInBounds(r.left, r.right, tree);
if (repairType == AutoRepairConfig.RepairType.INCREMENTAL)
{
canonicalSSTables = canonicalSSTables.stream().filter((sstable) -> !sstable.isRepaired()).collect(Collectors.toList());
}
refs = Refs.tryRef(canonicalSSTables);
}
return refs;
}
@Override
public void setParameter(String key, String value)
{
if (!PARAMETERS.contains(key))
{
throw new IllegalArgumentException("Unexpected parameter '" + key + "', must be one of " + PARAMETERS);
}
logger.info("Setting {} to {} for repair type {}", key, value, repairType);
givenParameters.put(key, value);
reinitParameters();
}
@Override
public Map<String, String> getParameters()
{
final Map<String, String> parameters = new LinkedHashMap<>();
for (String parameter : PARAMETERS)
{
// Use the parameter as provided if present.
if (givenParameters.containsKey(parameter))
{
parameters.put(parameter, givenParameters.get(parameter));
continue;View on GitHub (pinned to 88fd0f6a0e)