{"record":{"id":"e405ae0a83aa07c8","repo":"apache/cassandra","slug":"invalid-value-s-for-s-repair-sub-option-must","errorCode":null,"errorMessage":"Invalid value %s for '%s' repair sub-option - must be a boolean","messagePattern":"Invalid value (.+?) for '(.+?)' repair sub-option - must be a boolean","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/schema/AutoRepairParams.java","lineNumber":114,"sourceCode":"\n    public int priority()\n    {\n        String priority = options.getOrDefault(Option.PRIORITY.toString(), DEFAULT_OPTIONS.get(Option.PRIORITY.toString()));\n        return Integer.parseInt(priority);\n    }\n\n    public void validate()\n    {\n        for (Option option : Option.values())\n        {\n            if (!options.containsKey(LocalizeString.toLowerCaseLocalized(option.toString())))\n            {\n                throw new ConfigurationException(format(\"Missing repair sub-option '%s'\", option));\n            }\n        }\n        if (options.get(LocalizeString.toLowerCaseLocalized(Option.FULL_ENABLED.toString())) != null && !isValidBoolean(options.get(LocalizeString.toLowerCaseLocalized(Option.FULL_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.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\",","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/schema/AutoRepairParams.java#L96-L132","documentation":"AutoRepairParams.validate checks that the full_enabled sub-option parses as a boolean; anything else ('yes', '1', 'on', an empty string) throws ConfigurationException. This guards the table schema from storing an auto-repair setting that can never be evaluated.","triggerScenarios":"ALTER TABLE ... WITH auto_repair = {'full_enabled': 'yes', ...} — any non-boolean literal for full_enabled.","commonSituations":"Users familiar with 'yes/no' or '1/0' conventions from other databases or YAML; generated configs interpolating wrong types into the CQL string.","solutions":["Use the literal strings 'true' or 'false' for full_enabled","Quote the value properly in the CQL options map","Sanitize/validate the boolean in any tooling that generates the statement"],"exampleFix":"// before\nWITH auto_repair = {'full_enabled': 'yes', ...}\n// after\nWITH auto_repair = {'full_enabled': 'true', ...}","handlingStrategy":"validation","validationCode":"String v = opts.get(\"full_enabled\");\nif (v != null && !v.equalsIgnoreCase(\"true\") && !v.equalsIgnoreCase(\"false\"))\n    throw new IllegalArgumentException(\"full_enabled must be true or false\");","typeGuard":null,"tryCatchPattern":"try { params.validate(); } catch (ConfigurationException e) { if (e.getMessage().contains(\"full_enabled\") && e.getMessage().contains(\"boolean\")) { /* coerce value to 'true'/'false' and retry */ } else throw e; }","preventionTips":["Only emit 'true'/'false' literals for boolean sub-options","Centralize auto_repair map construction in one utility","Lint generated CQL for boolean fields"],"tags":["schema","configuration","boolean"],"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-17T15:17:12.973Z"}