apache/cassandra · error · ConfigurationException
Missing property value or default value is not set: ${key}
Error message
Missing property value or default value is not set: ${key} What it means
Thrown by CassandraRelevantProperties.getLong() when a system property has neither a runtime value (System.getProperty returns null) nor a configured default. The property descriptor was declared without a default, so the library refuses to guess a long value.
Source
Thrown at src/java/org/apache/cassandra/config/CassandraRelevantProperties.java:931
* @return System property value if it exists, defaultValue otherwise. Throws an exception if no default value is set.
*/
public int getInt()
{
String value = System.getProperty(key);
if (value == null && defaultVal == null)
throw new ConfigurationException("Missing property value or default value is not set: " + key);
return INTEGER_CONVERTER.convert(value == null ? defaultVal : value);
}
/**
* Gets the value of a system property as a long.
* @return System property value if it exists, defaultValue otherwise. Throws an exception if no default value is set.
*/
public long getLong()
{
String value = System.getProperty(key);
if (value == null && defaultVal == null)
throw new ConfigurationException("Missing property value or default value is not set: " + key);
return LONG_CONVERTER.convert(value == null ? defaultVal : value);
}
/**
* Gets the value of a system property as a long.
* @return system property long value if it exists, defaultValue otherwise.
*/
public long getLong(long overrideDefaultValue)
{
String value = System.getProperty(key);
if (value == null)
return overrideDefaultValue;
return LONG_CONVERTER.convert(value);
}
/**
* Gets the value of a system property as a double.View on GitHub (pinned to 88fd0f6a0e)
Solutions
- Set the system property, e.g. -Dcassandra.sometuning=1024
- Use getLong(defaultValue) overload instead of the no-arg version
- Declare a default value when constructing the CassandraRelevantProperties entry
- Check the property's existence with props.isPresent()/System.getProperty(key) before calling
Example fix
// before long size = CassandraRelevantProperties.SOME_TUNING.getLong(); // after long size = CassandraRelevantProperties.SOME_TUNING.getLong(1024L);
Defensive patterns
Strategy: validation
Validate before calling
String raw = System.getProperty("cassandra.some_tuning");
if (raw == null) throw new IllegalStateException("Set -Dcassandra.some_tuning"); Try / catch
try {
long v = CassandraRelevantProperties.SOME_TUNING.getLong();
} catch (ConfigurationException e) {
long v = 1024L; // explicit fallback
} Prevention
- Prefer getLong(defaultValue) over the no-arg getter
- Declare defaults for all property descriptors
- Set required -D properties in cassandra-env.sh
When it happens
Trigger: Calling props.getLong() on a CassandraRelevantProperties entry created without a default and without -Dkey=value set in the JVM.
Common situations: Tests or tools reading new tuning properties not set in cassandra-env.sh, code added a property without a default then a caller used the no-default getter, unit tests starting Cassandra in-process with stripped system properties.
Understand the failure class
Background: "missing required config value" errors: why libraries refuse to start when a configuration key is empty, unset, or blank — this error's family across 48 libraries.
Related errors
- Bad value for system property -D%s.Please use a value betwee
- Invalid value for system propery '%s': expected one of %s (c
- Invalid value for system property: expected integer value bu
- Invalid value for system property: expected long value but g
- Invalid value for system property: expected size in bytes wi
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/cca61bc3e8bec4c8.
Report an issue: GitHub.