{"record":{"id":"8c4dc004c0654cda","repo":"apache/cassandra","slug":"invalid-value-for-s-null-is-not-allowed","errorCode":null,"errorMessage":"Invalid value for %s: null is not allowed","messagePattern":"Invalid value for (.+?): null is not allowed","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/GuardrailsOptions.java","lineNumber":1623,"sourceCode":"    private static void validateSizeThreshold(DataStorageSpec.LongBytesBound warn, DataStorageSpec.LongBytesBound fail, String name)\n    {\n        validateWarnLowerThanFail(warn, fail, name);\n    }\n\n    private static void validateWarnLowerThanFail(DataStorageSpec.LongBytesBound warn, DataStorageSpec.LongBytesBound fail, String name)\n    {\n        if (warn == null || fail == null)\n            return;\n\n        if (fail.toBytes() < warn.toBytes())\n            throw new IllegalArgumentException(format(\"The warn threshold %s for %s_warn_threshold should be lower \" +\n                                                      \"than the fail threshold %s\", warn, name, fail));\n    }\n\n    private static Set<String> validateTableProperties(Set<String> properties, String name)\n    {\n        if (properties == null)\n            throw new IllegalArgumentException(format(\"Invalid value for %s: null is not allowed\", name));\n\n        Set<String> lowerCaseProperties = properties.stream().map(String::toLowerCase).collect(toSet());\n\n        Set<String> diff = Sets.difference(lowerCaseProperties, TableAttributes.allKeywords());\n\n        if (!diff.isEmpty())\n            throw new IllegalArgumentException(invalidValueMessage(name, diff, \"table\"));\n\n        return lowerCaseProperties;\n    }\n\n    private static Set<String> validateKeyspaceProperties(Set<String> properties, String name)\n    {\n        if (properties == null)\n            throw new IllegalArgumentException(format(\"Invalid value for %s: null is not allowed\", name));\n\n        Set<String> lowerCaseProperties = properties.stream().map(LocalizeString::toLowerCaseLocalized).collect(toSet());\n","sourceCodeStart":1605,"sourceCodeEnd":1641,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/GuardrailsOptions.java#L1605-L1641","documentation":"Table-property guardrail settings (e.g. table_properties_disallowed / table_properties_ignored) must be a non-null set. validateTableProperties() throws IllegalArgumentException when the configured value is null, before lowercasing and validating the property names against TableAttributes.allKeywords().","triggerScenarios":"cassandra.yaml (or a programmatic Config mutation) leaving a table-properties guardrail explicitly set to null or unset where validation expects a list; calling the guardrail setter with null for the properties set.","commonSituations":"Hand-written yaml accidentally commenting out the list while keeping the key shape; config-merge tooling dropping the list value; YAML parsing producing null for an empty/blank list value like 'table_properties_disallowed:'.","solutions":["Provide a non-empty (or at least explicit) list value in cassandra.yaml, e.g. table_properties_disallowed: [] if none.","Replace the null setter call with Set.of() / an empty immutable set in programmatic config.","Fix YAML indentation/blank values that deserialize to null."],"exampleFix":"// before (yaml)\ntable_properties_disallowed:\n// after\ntable_properties_disallowed: []","handlingStrategy":"validation","validationCode":"Set<String> props = cfg.table_properties_disallowed;\nif (props == null) throw new IllegalArgumentException(\"table_properties guardrail must not be null; use an empty set to allow everything\");","typeGuard":"if (props == null) props = Set.of();","tryCatchPattern":"try { applyTablePropertyGuardrails(props); } catch (IllegalArgumentException e) { log.error(\"table_properties guardrail misconfigured: {}\", e.getMessage()); throw e; }","preventionTips":["In yaml, an empty value ('key:') parses to null; write 'key: []' explicitly.","Prefer omitting the key (defaults) over a null value.","Check config-merge tool output for dropped list values."],"tags":["config","guardrails","null","cassandra"],"backgroundTag":"null-argument","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"}