apache/cassandra · error · ConfigurationException
Invalid value %s for '%s' repair sub-option - must be an int
Error message
Invalid value %s for '%s' repair sub-option - must be an integer
What it means
AutoRepairParams.validate() checks each 'repair' table option parsed from CREATE/ALTER TABLE. When the 'priority' sub-option is present it must parse as an integer; if isValidInt() rejects it, Cassandra throws ConfigurationException and the schema statement is rejected.
Source
Thrown at src/java/org/apache/cassandra/schema/AutoRepairParams.java:132
throw new ConfigurationException(format("Invalid value %s for '%s' repair sub-option - must be a boolean",
options.get(LocalizeString.toLowerCaseLocalized(Option.FULL_ENABLED.toString())),
Option.FULL_ENABLED));
}
if (options.get(LocalizeString.toLowerCaseLocalized(Option.INCREMENTAL_ENABLED.toString())) != null && !isValidBoolean(options.get(LocalizeString.toLowerCaseLocalized(Option.INCREMENTAL_ENABLED.toString()))))
{
throw new ConfigurationException(format("Invalid value %s for '%s' repair sub-option - must be a boolean",
options.get(LocalizeString.toLowerCaseLocalized(Option.INCREMENTAL_ENABLED.toString())),
Option.INCREMENTAL_ENABLED));
}
if (options.get(LocalizeString.toLowerCaseLocalized(Option.PREVIEW_REPAIRED_ENABLED.toString())) != null && !isValidBoolean(options.get(LocalizeString.toLowerCaseLocalized(Option.PREVIEW_REPAIRED_ENABLED.toString()))))
{
throw new ConfigurationException(format("Invalid value %s for '%s' repair sub-option - must be a boolean",
options.get(LocalizeString.toLowerCaseLocalized(Option.PREVIEW_REPAIRED_ENABLED.toString())),
Option.PREVIEW_REPAIRED_ENABLED));
}
if (options.get(LocalizeString.toLowerCaseLocalized(Option.PRIORITY.toString())) != null && !isValidInt(options.get(LocalizeString.toLowerCaseLocalized(Option.PRIORITY.toString()))))
{
throw new ConfigurationException(format("Invalid value %s for '%s' repair sub-option - must be an integer",
options.get(LocalizeString.toLowerCaseLocalized(Option.PRIORITY.toString())),
Option.PRIORITY));
}
}
public static boolean isValidBoolean(String value)
{
return StringUtils.equalsIgnoreCase(value, "true") || StringUtils.equalsIgnoreCase(value, "false");
}
public static boolean isValidInt(String value)
{
return StringUtils.isNumeric(value);
}
public Map<String, String> options()
{
return options;View on GitHub (pinned to 88fd0f6a0e)
Solutions
- Supply 'priority' as a plain integer, e.g. repair = {'enabled': true, 'priority': 1}
- Remove the 'priority' sub-option to use the default
- Re-check the exact string for whitespace/quotes: run SELECT default_time_to_live-like validation by re-executing the statement with only ASCII digits
Example fix
// before
CREATE TABLE t (k int PRIMARY KEY) WITH repair = {'enabled': true, 'priority': 'high'};
// after
CREATE TABLE t (k int PRIMARY KEY) WITH repair = {'enabled': true, 'priority': 1}; Defensive patterns
Strategy: validation
Validate before calling
String p = opts.get("priority");
if (p != null && !p.trim().matches("\\d+")) throw new IllegalArgumentException("repair.priority must be an integer: " + p); Type guard
boolean isValidPriority(String v) { return v != null && v.trim().matches("^-?\\d+$"); } Try / catch
try { session.execute(schemaDdl); } catch (com.datastax.driver.core.exceptions.InvalidQueryException | org.apache.cassandra.exceptions.ConfigurationException e) { if (e.getMessage().contains("repair sub-option")) { /* fix option map and retry */ } else throw e; } Prevention
- Always quote integers as bare digits in WITH option maps
- Validate table option maps in your schema-migration tooling before executing DDL
- Pin schema options in version control and review against the Cassandra version's accepted option set
When it happens
Trigger: Executing CREATE TABLE ... WITH repair = {'enabled': true, 'priority': 'high'} or any non-integer string (e.g. '10.5', 'abc', with stray whitespace) for the 'priority' repair sub-option via cqlsh or the driver schema API.
Common situations: Typo or copy-paste of priority values from other systems (thread priorities like 'high'/'low'), quoted numbers with spaces, or locale-formatted numbers when defining auto-repair table options.
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
- MapType takes exactly 2 type parameters
- Invalid caching sub-options %s: only '%s' and '%s' are allow
- Invalid value '%s' for caching sub-option '%s': only '%s' an
- Invalid value '%s' for caching sub-option '%s': only '%s', '
- Invalid value %s for '%s' compaction sub-option - must be an
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/b26aa56b3ceb9cb5.
Report an issue: GitHub.