apache/cassandra · info

Detected JVM property

Error message

Detected JVM property {}={} override for Cassandra configuration '{}'.

What it means

Warning from YamlConfigurationLoader.maybeAddSystemProperties when a JVM system property prefixed with cassandra. (SYSTEM_PROPERTY_PREFIX) maps to a recognized, overridable configuration key. Cassandra applies the property as an override over the cassandra.yaml value and logs it once (guarded by hasLoggedConfig per CASSANDRA-9909 to avoid flooding). It confirms config is coming from the JVM environment, not yaml.

Solutions

  1. Remove the unwanted -Dcassandra.<key> property from JVM_OPTS/cassandra-env.sh/startup scripts if the yaml value should win.
  2. If intentional, no action — but be aware the system property takes precedence over cassandra.yaml.
  3. Compare effective config via the system schema/config tables or logs to see which source won.
  4. In tests, avoid leaking -D properties between suites via shared JVM options.

Example fix

// before (cassandra-env.sh)
JVM_OPTS="$JVM_OPTS -Dcassandra.cluster_name=TestCluster"
// after
# removed override; cluster_name now comes from cassandra.yaml
Defensive patterns

Strategy: validation

Validate before calling

# detect -Dcassandra.* overrides before start
echo "$JVM_OPTS" | tr ' ' '\n' | grep '^-[D]cassandra\.' || echo 'no system-property overrides'

Prevention

When it happens

Trigger: Starting Cassandra (or an embedded-session/test using DatabaseDescriptor) with -Dcassandra.<key>=<value> where <key> is in OVERRIDABLE_CONFIG_NAMES, e.g. -Dcassandra.cluster_name=Foo or -Dcassandra.native_transport_port=9042, causing the yaml value to be overridden.

Common situations: JVM_OPTS / cassandra-env.sh carrying stale -Dcassandra.* flags; container images baking in system-property overrides that silently trump mounted cassandra.yaml; test frameworks injecting properties; confusion when yaml edits appear to have no effect.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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

Appendix: source

Thrown at src/java/org/apache/cassandra/config/YamlConfigurationLoader.java:206

        if (CONFIG_ALLOW_SYSTEM_PROPERTIES.getBoolean())
        {
            Map<String, String> orderedPropertiesMap = new TreeMap<>();
            java.util.Properties props = System.getProperties();
            props.stringPropertyNames().forEach(key -> orderedPropertiesMap.put(key, props.getProperty(key)));

            Map<String, Object> overridingProperties = new HashMap<>();
            for (String originalKey : orderedPropertiesMap.keySet())
            {
                if (originalKey.startsWith(SYSTEM_PROPERTY_PREFIX))
                {
                    String value = props.getProperty(originalKey);
                    String configKey = originalKey.replace(SYSTEM_PROPERTY_PREFIX, "");
                    if (OVERRIDABLE_CONFIG_NAMES.contains(configKey))
                    {
                        if (value != null && !overridingProperties.containsKey(configKey))
                        {
                            if (!DatabaseDescriptor.hasLoggedConfig()) // CASSANDRA-9909: Avoid flooding config during initialization
                                logger.warn("Detected JVM property {}={} override for Cassandra configuration '{}'.", originalKey, value, configKey);
                            overridingProperties.put(configKey, getScalarOrJsonTree(value));
                        }
                    }
                    else
                    {
                        logger.warn("Used sytem property variable {} to override Cassandra configuration but there is no such system property counter-part to override.", originalKey);
                    }
                }
            }
            if (!overridingProperties.isEmpty())
                updateFromMap(maybeFlattenNestedProperties(overridingProperties), false, obj);
        }
    }

    private static void maybeAddEnvironmentVariables(Object obj)
    {
        if (CONFIG_ALLOW_ENVIRONMENT_VARIABLES.getBoolean(CASSANDRA_ALLOW_CONFIG_ENVIRONMENT_VARIABLES.getBooleanOrDefault(false)))
        {

View on GitHub (pinned to 88fd0f6a0e)