apache/cassandra · error · ConfigurationException

%s can not be greater than %s

Error message

%s can not be greater than %s

What it means

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.

Source

Thrown at src/java/org/apache/cassandra/db/guardrails/CassandraPasswordConfiguration.java:180

    public void validateParameters() throws ConfigurationException
    {
        if (maxLength < 0) throw mustBePositiveException(MAX_LENGTH_KEY);
        if (characteristicsWarn < 0) throw mustBePositiveException(CHARACTERISTIC_WARN_KEY);
        if (characteristicsFail < 0) throw mustBePositiveException(CHARACTERISTIC_FAIL_KEY);
        if (lowerCaseWarn < 0) throw mustBePositiveException(LOWER_CASE_WARN_KEY);
        if (lowerCaseFail < 0) throw mustBePositiveException(LOWER_CASE_FAIL_KEY);
        if (upperCaseWarn < 0) throw mustBePositiveException(UPPER_CASE_WARN_KEY);
        if (upperCaseFail < 0) throw mustBePositiveException(UPPER_CASE_FAIL_KEY);
        if (specialsWarn < 0) throw mustBePositiveException(SPECIAL_WARN_KEY);
        if (specialsFail < 0) throw mustBePositiveException(SPECIAL_FAIL_KEY);
        if (digitsWarn < 0) throw mustBePositiveException(DIGIT_WARN_KEY);
        if (digitsFail < 0) throw mustBePositiveException(DIGIT_FAIL_KEY);
        if (lengthWarn < 0) throw mustBePositiveException(LENGTH_WARN_KEY);
        if (lengthFail < 0) throw mustBePositiveException(LENGTH_FAIL_KEY);

        if (MAX_LENGTH < maxLength)
            throw new ConfigurationException(format("%s can not be greater than %s",
                                                    MAX_LENGTH_KEY,
                                                    MAX_LENGTH));

        if (maxLength <= lengthWarn)
            throw getValidationException(MAX_LENGTH_KEY, maxLength, LENGTH_WARN_KEY, lengthWarn);

        if (lengthWarn <= lengthFail)
            throw getValidationException(LENGTH_WARN_KEY, lengthWarn, LENGTH_FAIL_KEY, lengthFail);

        if (specialsWarn <= specialsFail)
            throw getValidationException(SPECIAL_WARN_KEY,
                                         specialsWarn,
                                         SPECIAL_FAIL_KEY,
                                         specialsFail);

        if (digitsWarn <= digitsFail)
            throw getValidationException(DIGIT_WARN_KEY,
                                         digitsWarn,

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Lower max_length in cassandra.yaml to a value <= the reported MAX_LENGTH constant
  2. If a larger limit is genuinely needed, it requires a code change/upstream patch to raise MAX_LENGTH
  3. Validate config against the version's documented limits before deploying

Example fix

// before
password_guardrails:
  max_length: 999
// after
password_guardrails:
  max_length: 128
Defensive patterns

Strategy: validation

Validate before calling

if (maxLength > MAX_LENGTH)
    throw new ConfigurationException("max_length can not be greater than " + MAX_LENGTH);

Prevention

When it happens

Trigger: Setting the password max_length guardrail above the hardcoded MAX_LENGTH constant in cassandra.yaml, then triggering configuration validation at construction time.

Common situations: Administrators raising limits without checking the documented maximum; copying config from a newer version where MAX_LENGTH differs; unclear documentation of the ceiling value.

Understand the failure class

Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/8a0ef720dcf19e9e. Report an issue: GitHub.