apache/cassandra · error · org.apache.cassandra.config.YAMLException

Failed calling getter for property

Error message

Failed calling getter for property '%s' on class %s

What it means

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.

Solutions

  1. Inspect the wrapped cause (e.getCause()) to find the real exception thrown by the getter
  2. Fix the getter on the named class to handle null/uninitialized state
  3. Correct the offending value in cassandra.yaml that makes the getter throw
  4. Verify the config class version matches the Cassandra build in use

Example fix

// before
public Duration getRequestTimeout()
{
    return request_timeout.toDuration();
}
// after
public Duration getRequestTimeout()
{
    return request_timeout == null ? Defaults.REQUEST_TIMEOUT : request_timeout.toDuration();
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-validate yaml keys against known config properties before load
for (String key : yamlKeys) {
    if (!KNOWN_CONFIG_PROPERTIES.contains(key.toLowerCase(Locale.ROOT)))
        throw new IllegalArgumentException("Unknown config property: " + key);
}

Try / catch

try {
    Config config = loader.load(...);
} catch (YAMLException e) {
    Throwable cause = e.getCause();
    logger.error("Failed loading property getter: {}", e.getMessage(), cause);
    throw new ConfigurationException("Config load failed: " + cause.getMessage(), e);
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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

Appendix: source

Thrown at src/java/org/apache/cassandra/config/DefaultLoader.java:116

        }

        @Override
        public Object get(Object object)
        {
            if (!isReadable())
                throw new YAMLException("No readable property '" + getName() + "' on class: " + object.getClass().getName());

            try
            {
                return readMethod.invoke(object);
            }
            catch (IllegalAccessException e)
            {
                throw new YAMLException("Unable to find getter for property '" + getName() + "' on class " + object.getClass().getName(), e);
            }
            catch (InvocationTargetException e)
            {
                throw new YAMLException("Failed calling getter for property '" + getName() + "' on class " + object.getClass().getName(), e.getCause());
            }
        }
    }
}

View on GitHub (pinned to 88fd0f6a0e)