{"record":{"id":"57440db356f9d031","repo":"apache/cassandra","slug":"configuration-entry-s-can-not-inherit-itself","errorCode":null,"errorMessage":"Configuration entry %s can not inherit itself.","messagePattern":"Configuration entry (.+?) can not inherit itself\\.","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/schema/MemtableParams.java","lineNumber":158,"sourceCode":"    {\n        if (memtableConfigurations == null)\n            return ImmutableMap.of(DEFAULT_CONFIGURATION_KEY, DEFAULT_CONFIGURATION);\n\n        LinkedHashMap<String, ParameterizedClass> configs = new LinkedHashMap<>(memtableConfigurations.size() + 1);\n\n        // If default is not overridden, add an entry first so that other configurations can inherit from it.\n        // If it is, process it in its point of definition, so that the default can inherit from another configuration.\n        if (!memtableConfigurations.containsKey(DEFAULT_CONFIGURATION_KEY))\n            configs.put(DEFAULT_CONFIGURATION_KEY, DEFAULT_CONFIGURATION);\n\n        Map<String, InheritingClass> inheritingClasses = new LinkedHashMap<>();\n\n        for (Map.Entry<String, InheritingClass> entry : memtableConfigurations.entrySet())\n        {\n            if (entry.getValue().inherits != null)\n            {\n                if (entry.getKey().equals(entry.getValue().inherits))\n                    throw new ConfigurationException(String.format(\"Configuration entry %s can not inherit itself.\", entry.getKey()));\n\n                if (memtableConfigurations.get(entry.getValue().inherits) == null && !entry.getValue().inherits.equals(DEFAULT_CONFIGURATION_KEY))\n                    throw new ConfigurationException(String.format(\"Configuration entry %s inherits non-existing entry %s.\",\n                                                                   entry.getKey(), entry.getValue().inherits));\n\n                inheritingClasses.put(entry.getKey(), entry.getValue());\n            }\n            else\n                configs.put(entry.getKey(), entry.getValue().resolve(configs));\n        }\n\n        for (Map.Entry<String, InheritingClass> inheritingEntry : inheritingClasses.entrySet())\n        {\n            String inherits = inheritingEntry.getValue().inherits;\n            while (inherits != null)\n            {\n                InheritingClass nextInheritance = inheritingClasses.get(inherits);\n                if (nextInheritance == null)","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/schema/MemtableParams.java#L140-L176","documentation":"Thrown from MemtableParams.expandDefinitions while parsing cassandra.yaml memtable configurations: a named memtable configuration entry declares an 'inherits' that points at itself. Self-inheritance cannot be resolved, so configuration parsing fails with a ConfigurationException.","triggerScenarios":"cassandra.yaml contains memtable_configurations with an entry like 'small: {inherits: small, class_name: ...}' — entry key equals its own inherits value; expandDefinitions runs when building CONFIGURATION_DEFINITIONS at startup.","commonSituations":"Hand-editing cassandra.yaml and copy-pasting an inherits line without changing it, templating tools substituting the same key for both entry name and inherits.","solutions":["Edit cassandra.yaml so the entry's inherits points at a DIFFERENT existing entry (or remove inherits entirely).","Remove the 'inherits' field if the entry should define its own class_name/parameters directly.","Restart after fixing; validate YAML structure to ensure the key/value were not accidentally duplicated."],"exampleFix":"# before (cassandra.yaml)\nmemtable_configurations:\n  small:\n    inherits: small\n    class_name: DefaultMemtable\n# after\nmemtable_configurations:\n  small:\n    inherits: default\n    class_name: DefaultMemtable","handlingStrategy":"validation","validationCode":"# pre-check your YAML before node startup\npython3 -c \"import yaml; c=yaml.safe_load(open('conf/cassandra.yaml')); mc=c.get('memtable_configurations',{}); [print('self-inherit:',k) for k,v in mc.items() if isinstance(v,dict) and v.get('inherits')==k]\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Lint cassandra.yaml memtable_configurations for self-references before restart.","Never let config templating substitute the entry key into its own inherits field.","Prefer explicit class_name over inherits unless inheritance is truly needed."],"tags":["cassandra","configuration","yaml","memtable"],"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-14T16:17:12.679Z"}