{"record":{"id":"b429d251b8c48c4d","repo":"apache/cassandra","slug":"configuration-definition-inherits-unknown-inherit","errorCode":null,"errorMessage":"Configuration definition inherits unknown <inherits>. A configuration can only extend one defined earlier or \"default\".","messagePattern":"Configuration definition inherits unknown <inherits>\\. A configuration can only extend one defined earlier or \"default\"\\.","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/InheritingClass.java","lineNumber":54,"sourceCode":"    {\n        super(class_name, parameters);\n        this.inherits = inherits;\n    }\n\n    @SuppressWarnings(\"unused\")\n    public InheritingClass(Map<String, ?> p)\n    {\n        super(p);\n        this.inherits = p.get(\"inherits\").toString();\n    }\n\n    public ParameterizedClass resolve(Map<String, ParameterizedClass> map)\n    {\n        if (inherits == null)\n            return this;\n        ParameterizedClass parent = map.get(inherits);\n        if (parent == null)\n            throw new ConfigurationException(\"Configuration definition inherits unknown \" + inherits\n                                             + \". A configuration can only extend one defined earlier or \\\"default\\\".\");\n        Map<String, String> resolvedParameters;\n        if (parameters == null || parameters.isEmpty())\n            resolvedParameters = parent.parameters;\n        else if (parent.parameters == null || parent.parameters.isEmpty())\n            resolvedParameters = this.parameters;\n        else\n        {\n            resolvedParameters = new LinkedHashMap<>(parent.parameters);\n            resolvedParameters.putAll(this.parameters);\n        }\n\n        String resolvedClass = this.class_name == null ? parent.class_name : this.class_name;\n        return new ParameterizedClass(resolvedClass, resolvedParameters);\n    }\n\n    @Override\n    public String toString()","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/InheritingClass.java#L36-L72","documentation":"InheritingClass.resolve resolves an 'inherits' chain among ParameterizedClass configuration definitions. If the inherited name is absent from the provided map, ConfigurationException is thrown: a definition can only extend one that appears earlier in the config or the special \"default\". This prevents inheriting from unknown/undefined configurations.","triggerScenarios":"Setting 'inherits: someParent' on a config class (e.g. commitlog archiver, client config definitions) in cassandra.yaml where 'someParent' is not defined anywhere, or is defined later than the inheritor, or is misspelled.","commonSituations":"Renaming a base configuration without updating children; misspelling the parent name; ordering children before parents in the config; expecting an implicitly-defined default other than the literal \"default\".","solutions":["Define the inherited configuration earlier in the config map, or use the reserved name \"default\".","Fix the 'inherits' name spelling to match an existing definition.","Remove the 'inherits' key if inheritance is not needed."],"exampleFix":"// before\nmy_encoder:\n  class_name: MyEncoder\n  inherits: base_encoder  # not defined\n// after\nmy_encoder:\n  class_name: MyEncoder\n  inherits: default","handlingStrategy":"try-catch","validationCode":"Map<String,ParameterizedClass> defs = ...;\nif (def.inherits != null && !\"default\".equals(def.inherits) && !defs.containsKey(def.inherits))\n    throw new ConfigurationException(\"inherits unknown parent: \" + def.inherits);","typeGuard":null,"tryCatchPattern":"try { cls.resolve(map); } catch (ConfigurationException e) { LOG.error(\"config inheritance broken: {}\", e.getMessage()); throw e; }","preventionTips":["Define parent configurations before children in the config map","Only inherit from explicitly defined entries or the literal \"default\"","Grep the config for all 'inherits:' values and check each is defined"],"tags":["config","inheritance"],"backgroundTag":"missing-config-key","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"}