apache/cassandra · error · ConfigurationException
Invalid value of auto_snapshot_ttl: ${conf.auto_snapshot_ttl
Error message
Invalid value of auto_snapshot_ttl: ${conf.auto_snapshot_ttl} What it means
Cassandra validates auto_snapshot_ttl at startup by parsing it into DurationSpec.IntSecondsBound. If the configured string is not a valid duration (wrong format or unit not accepted for seconds-bound), the IllegalArgumentException is rethrown as a ConfigurationException with the offending raw value.
Source
Thrown at src/java/org/apache/cassandra/config/DatabaseDescriptor.java:632
}
private static void applySimpleConfig()
{
//Doing this first before all other things in case other pieces of config want to construct
//InetAddressAndPort and get the right defaults
InetAddressAndPort.initializeDefaultPort(getStoragePort());
validateUpperBoundStreamingConfig();
if (conf.auto_snapshot_ttl != null)
{
try
{
autoSnapshoTtl = new DurationSpec.IntSecondsBound(conf.auto_snapshot_ttl);
}
catch (IllegalArgumentException e)
{
throw new ConfigurationException("Invalid value of auto_snapshot_ttl: " + conf.auto_snapshot_ttl, false);
}
}
if (conf.commitlog_sync == null)
{
throw new ConfigurationException("Missing required directive CommitLogSync", false);
}
if (conf.commitlog_sync == CommitLogSync.batch)
{
if (conf.commitlog_sync_period.toMilliseconds() != 0)
{
throw new ConfigurationException("Batch sync specified, but commitlog_sync_period found.", false);
}
logger.debug("Syncing log with batch mode");
}
else if (conf.commitlog_sync == CommitLogSync.group)
{View on GitHub (pinned to 88fd0f6a0e)
Solutions
- Set auto_snapshot_ttl to a valid duration string, e.g. '300s', '5m', or '0' to disable TTL
- Verify the unit suffix is one the IntSecondsBound spec accepts (seconds-based)
- Check cassandra.yaml syntax: value and unit separated properly, no stray characters
Example fix
# before (cassandra.yaml) auto_snapshot_ttl: 5hours # after auto_snapshot_ttl: 5h
Defensive patterns
Strategy: validation
Validate before calling
if (conf.auto_snapshot_ttl != null && !conf.auto_snapshot_ttl.matches("^\\d+(s|m|h|d)$")) throw new IllegalArgumentException("invalid auto_snapshot_ttl: " + conf.auto_snapshot_ttl); Try / catch
try { DatabaseDescriptor.daemonInitialization(); } catch (ConfigurationException e) { log.error("auto_snapshot_ttl invalid: {}", e.getMessage()); } Prevention
- Always include a unit suffix (e.g. '300s', '5m')
- Use '0' to disable snapshot TTL rather than garbage values
- Validate yaml in CI with Cassandra's config parser
When it happens
Trigger: cassandra.yaml contains auto_snapshot_ttl with an invalid value (e.g. 'abc', negative, or a unit unsupported by IntSecondsBound); DatabaseDescriptor.applySimpleConfig (via applyAll or toolInitialization) parses it.
Common situations: Typos like '5 mintues', using a unit not allowed for this spec, hand-edited yaml with missing spaces, or setting it to a negative duration.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- Invalid value %d for %s: negative values are not allowed, ou
- Invalid values for %s: '%s' do not parse as valid %s propert
- The duration months, days and nanoseconds must be all of the
- REVOKE operation is not supported by AllowAllAuthorizer
- %s is not a valid data resource name
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/0995b9cf7a89b9c0.
Report an issue: GitHub.