{"record":{"id":"5103dea9d0b2dc6e","repo":"apache/cassandra","slug":"enabled-should-either-be-true-or-false-not-s","errorCode":null,"errorMessage":"enabled should either be 'true' or 'false', not %s","messagePattern":"enabled should either be 'true' or 'false', not (.+?)","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/db/compaction/AbstractCompactionStrategy.java","lineNumber":508,"sourceCode":"            if (!unchecked.equalsIgnoreCase(\"true\") && !unchecked.equalsIgnoreCase(\"false\"))\n                throw new ConfigurationException(String.format(\"'%s' should be either 'true' or 'false', not '%s'\", UNCHECKED_TOMBSTONE_COMPACTION_OPTION, unchecked));\n        }\n\n        String logAll = options.get(LOG_ALL_OPTION);\n        if (logAll != null)\n        {\n            if (!logAll.equalsIgnoreCase(\"true\") && !logAll.equalsIgnoreCase(\"false\"))\n            {\n                throw new ConfigurationException(String.format(\"'%s' should either be 'true' or 'false', not %s\", LOG_ALL_OPTION, logAll));\n            }\n        }\n\n        String compactionEnabled = options.get(COMPACTION_ENABLED);\n        if (compactionEnabled != null)\n        {\n            if (!compactionEnabled.equalsIgnoreCase(\"true\") && !compactionEnabled.equalsIgnoreCase(\"false\"))\n            {\n                throw new ConfigurationException(String.format(\"enabled should either be 'true' or 'false', not %s\", compactionEnabled));\n            }\n        }\n\n        Map<String, String> uncheckedOptions = new HashMap<String, String>(options);\n        uncheckedOptions.remove(TOMBSTONE_THRESHOLD_OPTION);\n        uncheckedOptions.remove(TOMBSTONE_COMPACTION_INTERVAL_OPTION);\n        uncheckedOptions.remove(UNCHECKED_TOMBSTONE_COMPACTION_OPTION);\n        uncheckedOptions.remove(LOG_ALL_OPTION);\n        uncheckedOptions.remove(COMPACTION_ENABLED);\n        uncheckedOptions.remove(ONLY_PURGE_REPAIRED_TOMBSTONES);\n        uncheckedOptions.remove(CompactionParams.Option.PROVIDE_OVERLAPPING_TOMBSTONES.toString());\n        return uncheckedOptions;\n    }\n\n    /**\n     * Method for grouping similar SSTables together, This will be used by\n     * anti-compaction to determine which SSTables should be anitcompacted\n     * as a group. If a given compaction strategy creates sstables which","sourceCodeStart":490,"sourceCodeEnd":526,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/compaction/AbstractCompactionStrategy.java#L490-L526","documentation":"Thrown as a ConfigurationException when the compaction 'enabled' option is not the literal 'true' or 'false'. This option toggles whether the compaction strategy schedules background compactions, and its value is validated strictly at configuration time.","triggerScenarios":"CREATE/ALTER TABLE with {'enabled': 'yes'} or {'enabled': 'on'} in the compaction options map.","commonSituations":"Copying option values from non-Java configuration formats, automation tools templating booleans as 0/1 or yes/no.","solutions":["Set enabled to 'true' or 'false'.","To pause compaction temporarily, use nodetool disableautocompaction instead of misconfiguring the option.","Remove the option to accept the default (enabled)."],"exampleFix":"// before\n{'class': 'SizeTieredCompactionStrategy', 'enabled': 'no'}\n// after\n{'class': 'SizeTieredCompactionStrategy', 'enabled': 'false'}","handlingStrategy":"validation","validationCode":"String v = options.get(\"enabled\");\nif (v != null && !v.equalsIgnoreCase(\"true\") && !v.equalsIgnoreCase(\"false\")) throw new IllegalArgumentException(\"enabled must be true/false: \" + v);","typeGuard":null,"tryCatchPattern":"try { session.execute(alterCql); } catch (ConfigurationException e) { /* fix boolean literal and retry */ }","preventionTips":["Prefer nodetool enableautocompaction/disableautocompaction for runtime toggling instead of the enabled option","Standardize boolean rendering across config tooling"],"tags":["configuration","compaction","boolean"],"backgroundTag":"invalid-enum-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"}