{"record":{"id":"b26aa56b3ceb9cb5","repo":"apache/cassandra","slug":"invalid-value-s-for-s-repair-sub-option-must-b26aa5","errorCode":null,"errorMessage":"Invalid value %s for '%s' repair sub-option - must be an integer","messagePattern":"Invalid value (.+?) for '(.+?)' repair sub-option - must be an integer","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/schema/AutoRepairParams.java","lineNumber":132,"sourceCode":"            throw new ConfigurationException(format(\"Invalid value %s for '%s' repair sub-option - must be a boolean\",\n                                                    options.get(LocalizeString.toLowerCaseLocalized(Option.FULL_ENABLED.toString())),\n                                                    Option.FULL_ENABLED));\n        }\n        if (options.get(LocalizeString.toLowerCaseLocalized(Option.INCREMENTAL_ENABLED.toString())) != null && !isValidBoolean(options.get(LocalizeString.toLowerCaseLocalized(Option.INCREMENTAL_ENABLED.toString()))))\n        {\n            throw new ConfigurationException(format(\"Invalid value %s for '%s' repair sub-option - must be a boolean\",\n                                                    options.get(LocalizeString.toLowerCaseLocalized(Option.INCREMENTAL_ENABLED.toString())),\n                                                    Option.INCREMENTAL_ENABLED));\n        }\n        if (options.get(LocalizeString.toLowerCaseLocalized(Option.PREVIEW_REPAIRED_ENABLED.toString())) != null && !isValidBoolean(options.get(LocalizeString.toLowerCaseLocalized(Option.PREVIEW_REPAIRED_ENABLED.toString()))))\n        {\n            throw new ConfigurationException(format(\"Invalid value %s for '%s' repair sub-option - must be a boolean\",\n                                                    options.get(LocalizeString.toLowerCaseLocalized(Option.PREVIEW_REPAIRED_ENABLED.toString())),\n                                                    Option.PREVIEW_REPAIRED_ENABLED));\n        }\n        if (options.get(LocalizeString.toLowerCaseLocalized(Option.PRIORITY.toString())) != null && !isValidInt(options.get(LocalizeString.toLowerCaseLocalized(Option.PRIORITY.toString()))))\n        {\n            throw new ConfigurationException(format(\"Invalid value %s for '%s' repair sub-option - must be an integer\",\n                                                    options.get(LocalizeString.toLowerCaseLocalized(Option.PRIORITY.toString())),\n                                                    Option.PRIORITY));\n        }\n    }\n\n    public static boolean isValidBoolean(String value)\n    {\n        return StringUtils.equalsIgnoreCase(value, \"true\") || StringUtils.equalsIgnoreCase(value, \"false\");\n    }\n\n    public static boolean isValidInt(String value)\n    {\n        return StringUtils.isNumeric(value);\n    }\n\n    public Map<String, String> options()\n    {\n        return options;","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/schema/AutoRepairParams.java#L114-L150","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nCREATE TABLE t (k int PRIMARY KEY) WITH repair = {'enabled': true, 'priority': 'high'};\n// after\nCREATE TABLE t (k int PRIMARY KEY) WITH repair = {'enabled': true, 'priority': 1};","handlingStrategy":"validation","validationCode":"String p = opts.get(\"priority\");\nif (p != null && !p.trim().matches(\"\\\\d+\")) throw new IllegalArgumentException(\"repair.priority must be an integer: \" + p);","typeGuard":"boolean isValidPriority(String v) { return v != null && v.trim().matches(\"^-?\\\\d+$\"); }","tryCatchPattern":"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; }","preventionTips":["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"],"tags":["cassandra","schema","configuration"],"backgroundTag":"invalid-config-value","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}