{"record":{"id":"3095cd7115e45879","repo":"apache/cassandra","slug":"detected-jvm-property-override-for-cassandra","errorCode":null,"errorMessage":"Detected JVM property {}={} override for Cassandra configuration '{}'.","messagePattern":"Detected JVM property (.+?)=(.+?) override for Cassandra configuration '(.+?)'\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/java/org/apache/cassandra/config/YamlConfigurationLoader.java","lineNumber":206,"sourceCode":"        if (CONFIG_ALLOW_SYSTEM_PROPERTIES.getBoolean())\n        {\n            Map<String, String> orderedPropertiesMap = new TreeMap<>();\n            java.util.Properties props = System.getProperties();\n            props.stringPropertyNames().forEach(key -> orderedPropertiesMap.put(key, props.getProperty(key)));\n\n            Map<String, Object> overridingProperties = new HashMap<>();\n            for (String originalKey : orderedPropertiesMap.keySet())\n            {\n                if (originalKey.startsWith(SYSTEM_PROPERTY_PREFIX))\n                {\n                    String value = props.getProperty(originalKey);\n                    String configKey = originalKey.replace(SYSTEM_PROPERTY_PREFIX, \"\");\n                    if (OVERRIDABLE_CONFIG_NAMES.contains(configKey))\n                    {\n                        if (value != null && !overridingProperties.containsKey(configKey))\n                        {\n                            if (!DatabaseDescriptor.hasLoggedConfig()) // CASSANDRA-9909: Avoid flooding config during initialization\n                                logger.warn(\"Detected JVM property {}={} override for Cassandra configuration '{}'.\", originalKey, value, configKey);\n                            overridingProperties.put(configKey, getScalarOrJsonTree(value));\n                        }\n                    }\n                    else\n                    {\n                        logger.warn(\"Used sytem property variable {} to override Cassandra configuration but there is no such system property counter-part to override.\", originalKey);\n                    }\n                }\n            }\n            if (!overridingProperties.isEmpty())\n                updateFromMap(maybeFlattenNestedProperties(overridingProperties), false, obj);\n        }\n    }\n\n    private static void maybeAddEnvironmentVariables(Object obj)\n    {\n        if (CONFIG_ALLOW_ENVIRONMENT_VARIABLES.getBoolean(CASSANDRA_ALLOW_CONFIG_ENVIRONMENT_VARIABLES.getBooleanOrDefault(false)))\n        {","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java#L188-L224","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Remove the unwanted -Dcassandra.<key> property from JVM_OPTS/cassandra-env.sh/startup scripts if the yaml value should win.","If intentional, no action — but be aware the system property takes precedence over cassandra.yaml.","Compare effective config via the system schema/config tables or logs to see which source won.","In tests, avoid leaking -D properties between suites via shared JVM options."],"exampleFix":"// before (cassandra-env.sh)\nJVM_OPTS=\"$JVM_OPTS -Dcassandra.cluster_name=TestCluster\"\n// after\n# removed override; cluster_name now comes from cassandra.yaml","handlingStrategy":"validation","validationCode":"# detect -Dcassandra.* overrides before start\necho \"$JVM_OPTS\" | tr ' ' '\\n' | grep '^-[D]cassandra\\.' || echo 'no system-property overrides'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep -Dcassandra.* flags out of cassandra-env.sh unless intentional.","Document that system properties override yaml; choose one config source.","Compare effective config at runtime when yaml edits seem ignored."],"tags":["configuration","jvm","system-properties","yaml"],"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-17T15:17:12.973Z"}