{"record":{"id":"8a0ef720dcf19e9e","repo":"apache/cassandra","slug":"s-can-not-be-greater-than-s","errorCode":null,"errorMessage":"%s can not be greater than %s","messagePattern":"(.+?) can not be greater than (.+?)","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/db/guardrails/CassandraPasswordConfiguration.java","lineNumber":180,"sourceCode":"\n    public void validateParameters() throws ConfigurationException\n    {\n        if (maxLength < 0) throw mustBePositiveException(MAX_LENGTH_KEY);\n        if (characteristicsWarn < 0) throw mustBePositiveException(CHARACTERISTIC_WARN_KEY);\n        if (characteristicsFail < 0) throw mustBePositiveException(CHARACTERISTIC_FAIL_KEY);\n        if (lowerCaseWarn < 0) throw mustBePositiveException(LOWER_CASE_WARN_KEY);\n        if (lowerCaseFail < 0) throw mustBePositiveException(LOWER_CASE_FAIL_KEY);\n        if (upperCaseWarn < 0) throw mustBePositiveException(UPPER_CASE_WARN_KEY);\n        if (upperCaseFail < 0) throw mustBePositiveException(UPPER_CASE_FAIL_KEY);\n        if (specialsWarn < 0) throw mustBePositiveException(SPECIAL_WARN_KEY);\n        if (specialsFail < 0) throw mustBePositiveException(SPECIAL_FAIL_KEY);\n        if (digitsWarn < 0) throw mustBePositiveException(DIGIT_WARN_KEY);\n        if (digitsFail < 0) throw mustBePositiveException(DIGIT_FAIL_KEY);\n        if (lengthWarn < 0) throw mustBePositiveException(LENGTH_WARN_KEY);\n        if (lengthFail < 0) throw mustBePositiveException(LENGTH_FAIL_KEY);\n\n        if (MAX_LENGTH < maxLength)\n            throw new ConfigurationException(format(\"%s can not be greater than %s\",\n                                                    MAX_LENGTH_KEY,\n                                                    MAX_LENGTH));\n\n        if (maxLength <= lengthWarn)\n            throw getValidationException(MAX_LENGTH_KEY, maxLength, LENGTH_WARN_KEY, lengthWarn);\n\n        if (lengthWarn <= lengthFail)\n            throw getValidationException(LENGTH_WARN_KEY, lengthWarn, LENGTH_FAIL_KEY, lengthFail);\n\n        if (specialsWarn <= specialsFail)\n            throw getValidationException(SPECIAL_WARN_KEY,\n                                         specialsWarn,\n                                         SPECIAL_FAIL_KEY,\n                                         specialsFail);\n\n        if (digitsWarn <= digitsFail)\n            throw getValidationException(DIGIT_WARN_KEY,\n                                         digitsWarn,","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/guardrails/CassandraPasswordConfiguration.java#L162-L198","documentation":"Thrown as a ConfigurationException during CassandraPasswordConfiguration.validateParameters when the configured maxLength (maximum allowed password length) exceeds the hard constant MAX_LENGTH. The message reads '%s can not be greater than %s' with the max_length key and the built-in cap.","triggerScenarios":"Setting the password max_length guardrail above the hardcoded MAX_LENGTH constant in cassandra.yaml, then triggering configuration validation at construction time.","commonSituations":"Administrators raising limits without checking the documented maximum; copying config from a newer version where MAX_LENGTH differs; unclear documentation of the ceiling value.","solutions":["Lower max_length in cassandra.yaml to a value <= the reported MAX_LENGTH constant","If a larger limit is genuinely needed, it requires a code change/upstream patch to raise MAX_LENGTH","Validate config against the version's documented limits before deploying"],"exampleFix":"// before\npassword_guardrails:\n  max_length: 999\n// after\npassword_guardrails:\n  max_length: 128","handlingStrategy":"validation","validationCode":"if (maxLength > MAX_LENGTH)\n    throw new ConfigurationException(\"max_length can not be greater than \" + MAX_LENGTH);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check the version's documented MAX_LENGTH before raising the limit","Pin configuration templates to known-valid ranges per Cassandra version","Pre-validate config with the same constants used by the code"],"tags":["configuration","guardrails","validation"],"backgroundTag":"value-out-of-range","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"}