{"record":{"id":"c4c08063da06066f","repo":"apache/cassandra","slug":"s-should-either-be-true-or-false-not-s","errorCode":null,"errorMessage":"'%s' should either be 'true' or 'false', not %s","messagePattern":"'(.+?)' 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":499,"sourceCode":"            catch (NumberFormatException e)\n            {\n                throw new ConfigurationException(String.format(\"%s is not a parsable int (base10) for %s\", interval, TOMBSTONE_COMPACTION_INTERVAL_OPTION), e);\n            }\n        }\n\n        String unchecked = options.get(UNCHECKED_TOMBSTONE_COMPACTION_OPTION);\n        if (unchecked != null)\n        {\n            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);","sourceCodeStart":481,"sourceCodeEnd":517,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/compaction/AbstractCompactionStrategy.java#L481-L517","documentation":"Thrown as a ConfigurationException when the log_all option is not the literal 'true' or 'false'. log_all controls whether every tombstone compaction is logged, and validateOptions enforces strict boolean literals.","triggerScenarios":"CREATE/ALTER TABLE with compaction option {'log_all': '1'} or {'log_all': 'TRUE '} with stray characters — anything not equalIgnoreCase to true/false.","commonSituations":"Using numeric booleans from JSON configs, whitespace or quotes leaking into the option value from shell/cqlsh escaping.","solutions":["Set log_all to 'true' or 'false' exactly.","Remove the option to use the default.","Trim the value and re-run the schema change."],"exampleFix":"// before\n{'log_all': '1'}\n// after\n{'log_all': 'false'}","handlingStrategy":"validation","validationCode":"String v = options.get(\"log_all\");\nif (v != null && !v.equalsIgnoreCase(\"true\") && !v.equalsIgnoreCase(\"false\")) throw new IllegalArgumentException(\"must be true/false: \" + v);","typeGuard":null,"tryCatchPattern":"try { session.execute(alterCql); } catch (ConfigurationException e) { /* fix boolean literal and retry */ }","preventionTips":["Use a shared boolean serializer that emits true/false","Trim option values before submitting schema changes"],"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"}