{"record":{"id":"063ac9b0e0bdeee7","repo":"apache/cassandra","slug":"invalid-value-for-s-s-is-a-required-keyspace","errorCode":null,"errorMessage":"Invalid value for %s: '%s' is a required keyspace property","messagePattern":"Invalid value for (.+?): '(.+?)' is a required keyspace property","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/GuardrailsOptions.java","lineNumber":1645,"sourceCode":"        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\n        for (String requiredKeyword : KeyspaceAttributes.requiredKeywords())\n        {\n            if (lowerCaseProperties.contains(requiredKeyword))\n                throw new IllegalArgumentException(format(\"Invalid value for %s: '%s' is a required keyspace property\", name, requiredKeyword));\n        }\n\n        Set<String> diff = Sets.difference(lowerCaseProperties, KeyspaceAttributes.allKeywords());\n\n        if (!diff.isEmpty())\n            throw new IllegalArgumentException(invalidValueMessage(name, diff, \"keyspace\"));\n\n        return lowerCaseProperties;\n    }\n\n    public static String invalidValueMessage(String name, Set<String> invalidProperties, String type)\n    {\n        if (invalidProperties.size() == 1)\n            return format(\"Invalid value for %s: '%s' does not parse as valid %s property.\",\n                          name, invalidProperties, type);\n\n        return format(\"Invalid values for %s: '%s' do not parse as valid %s properties\",\n                      name, invalidProperties, type);","sourceCodeStart":1627,"sourceCodeEnd":1663,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/GuardrailsOptions.java#L1627-L1663","documentation":"Guardrails that constrain keyspace attributes (e.g. keyspace creation guardrails) validate the user-supplied property map. If the map contains a property that is a REQUIRED keyspace attribute (per KeyspaceAttributes.requiredKeywords(), like 'replication' in a relevant context), it cannot be used as a guardrail-controlled value, so an IllegalArgumentException is thrown. This prevents configuring a guardrail over something Cassandra always requires.","triggerScenarios":"Calling validateForbid/allow-list style guardrail configuration (e.g. setting guardrails for keyspace properties in cassandra.yaml or via Config with properties containing required keywords such as 'replication' or 'durable_writes') when the property set includes a required keyword.","commonSituations":"Operators adding keyspace property guardrails to cassandra.yaml and mistakenly listing 'replication' or 'durable_writes' in the guardrail's property list; copying guardrail config examples that include required keyspace attributes.","solutions":["Remove the required keyspace property (e.g. 'replication', 'durable_writes') from the guardrail's property list in cassandra.yaml.","Re-run Config validation / start the node to confirm the guardrail now validates.","Only list optional keyspace attributes in the guardrail; use other guardrails/mechanisms for required attributes."],"exampleFix":"// before (cassandra.yaml)\nreplication_properties_guardrail:\n  disallowed_properties: [replication, read_repair]\n// after\nreplication_properties_guardrail:\n  disallowed_properties: [read_repair]","handlingStrategy":"validation","validationCode":"Set<String> required = KeyspaceAttributes.requiredKeywords();\nif (props.stream().map(String::toLowerCase).anyMatch(required::contains))\n    throw new IllegalArgumentException(\"guardrail list must not include required keyspace properties\");","typeGuard":null,"tryCatchPattern":"try { config.validate(); } catch (IllegalArgumentException e) { LOG.error(\"guardrail config invalid: {}\", e.getMessage()); throw new ConfigurationException(e); }","preventionTips":["Diff the guardrail property list against KeyspaceAttributes.requiredKeywords() before shipping config","Never list replication/durable_writes in keyspace property guardrails"],"tags":["config","guardrails","keyspace"],"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-14T11:17:12.474Z"}