{"record":{"id":"616b562c60f87079","repo":"apache/cassandra","slug":"failed-calling-getter-for-property-s-on-class","errorCode":null,"errorMessage":"Failed calling getter for property '%s' on class %s","messagePattern":"Failed calling getter for property '(.+?)' on class (.+?)","errorType":"validation","errorClass":"org.apache.cassandra.config.YAMLException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DefaultLoader.java","lineNumber":116,"sourceCode":"        }\n\n        @Override\n        public Object get(Object object)\n        {\n            if (!isReadable())\n                throw new YAMLException(\"No readable property '\" + getName() + \"' on class: \" + object.getClass().getName());\n\n            try\n            {\n                return readMethod.invoke(object);\n            }\n            catch (IllegalAccessException e)\n            {\n                throw new YAMLException(\"Unable to find getter for property '\" + getName() + \"' on class \" + object.getClass().getName(), e);\n            }\n            catch (InvocationTargetException e)\n            {\n                throw new YAMLException(\"Failed calling getter for property '\" + getName() + \"' on class \" + object.getClass().getName(), e.getCause());\n            }\n        }\n    }\n}\n","sourceCodeStart":98,"sourceCodeEnd":121,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DefaultLoader.java#L98-L121","documentation":"DefaultLoader uses reflection to invoke property getters when loading configuration values. If the underlying getter method throws, it is rethrown as a YAMLException wrapping the cause, naming the property and class. It indicates the config object's getter failed while loading defaults.","triggerScenarios":"A property getter on a config class throws (InvocationTargetException) during Config.load / DefaultLoader.get, e.g. a computed getter with a null assumption or an exception inside a DurationSpec/PriceSpec conversion invoked via reflection.","commonSituations":"Custom or newly added config fields whose getter assumes another field is initialized; cassandra.yaml values that fail validation inside a getter; class version mismatch between loaded YAML and config classes.","solutions":["Inspect the wrapped cause (e.getCause()) to find the real exception thrown by the getter","Fix the getter on the named class to handle null/uninitialized state","Correct the offending value in cassandra.yaml that makes the getter throw","Verify the config class version matches the Cassandra build in use"],"exampleFix":"// before\npublic Duration getRequestTimeout()\n{\n    return request_timeout.toDuration();\n}\n// after\npublic Duration getRequestTimeout()\n{\n    return request_timeout == null ? Defaults.REQUEST_TIMEOUT : request_timeout.toDuration();\n}","handlingStrategy":"try-catch","validationCode":"// Pre-validate yaml keys against known config properties before load\nfor (String key : yamlKeys) {\n    if (!KNOWN_CONFIG_PROPERTIES.contains(key.toLowerCase(Locale.ROOT)))\n        throw new IllegalArgumentException(\"Unknown config property: \" + key);\n}","typeGuard":null,"tryCatchPattern":"try {\n    Config config = loader.load(...);\n} catch (YAMLException e) {\n    Throwable cause = e.getCause();\n    logger.error(\"Failed loading property getter: {}\", e.getMessage(), cause);\n    throw new ConfigurationException(\"Config load failed: \" + cause.getMessage(), e);\n}","preventionTips":["Make getters null-safe and free of heavy logic","Keep config classes and YAML schema in the same version","Unit-test config loading with your production cassandra.yaml","Wrap causes, don't swallow the YAMLException cause chain"],"tags":["reflection","config-loading","yaml"],"backgroundTag":"yaml-parse-error","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"}