{"record":{"id":"9c1885c76f0891d1","repo":"apache/cassandra","slug":"missing-repair-sub-option-s","errorCode":null,"errorMessage":"Missing repair sub-option '%s'","messagePattern":"Missing repair sub-option '(.+?)'","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/schema/AutoRepairParams.java","lineNumber":109,"sourceCode":"    {\n        String option = LocalizeString.toLowerCaseLocalized(type.toString()) + \"_enabled\";\n        String enabled = options.getOrDefault(option, DEFAULT_OPTIONS.get(option));\n        return Boolean.parseBoolean(enabled);\n    }\n\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())),","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/schema/AutoRepairParams.java#L91-L127","documentation":"AutoRepairParams.validate requires every Option enum key to be present in the options map; if any is missing it throws ConfigurationException. Unlike most Cassandra option maps, auto repair params are all-or-nothing: a partial map is treated as an invalid configuration rather than merged with defaults.","triggerScenarios":"CREATE/ALTER TABLE with auto_repair = {'full_enabled':'true'} supplying only some of the required sub-options (full_enabled, incremental_enabled, preview_repaired_enabled, priority, ...).","commonSituations":"Hand-written CQL that lists just one flag; migration scripts generating partial maps; tools that update a single option without rewriting the whole map.","solutions":["Supply ALL auto repair sub-options defined by the Option enum in the map","Read the current full map (e.g. from system_schema) and re-issue the complete set with your change","Use a driver/tool that builds the complete options map"],"exampleFix":"// before\nWITH auto_repair = {'full_enabled': 'true'}\n// after\nWITH auto_repair = {'full_enabled': 'true', 'incremental_enabled': 'false', 'preview_repaired_enabled': 'false', 'priority': '1'}","handlingStrategy":"validation","validationCode":"for (Option o : Option.values())\n    if (!autoRepairOptions.containsKey(o.toString().toLowerCase()))\n        throw new IllegalArgumentException(\"Missing auto repair sub-option: \" + o);","typeGuard":null,"tryCatchPattern":"try { params.validate(); } catch (ConfigurationException e) { if (e.getMessage().startsWith(\"Missing repair sub-option\")) { /* fill in all sub-options and re-apply */ } else throw e; }","preventionTips":["Always write the complete auto_repair map, never a partial one","Read the existing map from system_schema and merge before ALTERing","Use a schema-management tool that emits full option sets"],"tags":["schema","configuration","validation"],"backgroundTag":"missing-required-config-field","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"}