apache/cassandra · error · IllegalArgumentException

Invalid value for %s: null is not allowed

Error message

Invalid value for %s: null is not allowed

What it means

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().

Source

Thrown at src/java/org/apache/cassandra/config/GuardrailsOptions.java:1623

    private static void validateSizeThreshold(DataStorageSpec.LongBytesBound warn, DataStorageSpec.LongBytesBound fail, String name)
    {
        validateWarnLowerThanFail(warn, fail, name);
    }

    private static void validateWarnLowerThanFail(DataStorageSpec.LongBytesBound warn, DataStorageSpec.LongBytesBound fail, String name)
    {
        if (warn == null || fail == null)
            return;

        if (fail.toBytes() < warn.toBytes())
            throw new IllegalArgumentException(format("The warn threshold %s for %s_warn_threshold should be lower " +
                                                      "than the fail threshold %s", warn, name, fail));
    }

    private static Set<String> validateTableProperties(Set<String> properties, String name)
    {
        if (properties == null)
            throw new IllegalArgumentException(format("Invalid value for %s: null is not allowed", name));

        Set<String> lowerCaseProperties = properties.stream().map(String::toLowerCase).collect(toSet());

        Set<String> diff = Sets.difference(lowerCaseProperties, TableAttributes.allKeywords());

        if (!diff.isEmpty())
            throw new IllegalArgumentException(invalidValueMessage(name, diff, "table"));

        return lowerCaseProperties;
    }

    private static Set<String> validateKeyspaceProperties(Set<String> properties, String name)
    {
        if (properties == null)
            throw new IllegalArgumentException(format("Invalid value for %s: null is not allowed", name));

        Set<String> lowerCaseProperties = properties.stream().map(LocalizeString::toLowerCaseLocalized).collect(toSet());

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Provide a non-empty (or at least explicit) list value in cassandra.yaml, e.g. table_properties_disallowed: [] if none.
  2. Replace the null setter call with Set.of() / an empty immutable set in programmatic config.
  3. Fix YAML indentation/blank values that deserialize to null.

Example fix

// before (yaml)
table_properties_disallowed:
// after
table_properties_disallowed: []
Defensive patterns

Strategy: validation

Validate before calling

Set<String> props = cfg.table_properties_disallowed;
if (props == null) throw new IllegalArgumentException("table_properties guardrail must not be null; use an empty set to allow everything");

Type guard

if (props == null) props = Set.of();

Try / catch

try { applyTablePropertyGuardrails(props); } catch (IllegalArgumentException e) { log.error("table_properties guardrail misconfigured: {}", e.getMessage()); throw e; }

Prevention

When it happens

Trigger: 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.

Common situations: 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:'.

Related errors


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