{"record":{"id":"0995b9cf7a89b9c0","repo":"apache/cassandra","slug":"invalid-value-of-auto-snapshot-ttl-conf-auto-sn","errorCode":null,"errorMessage":"Invalid value of auto_snapshot_ttl: ${conf.auto_snapshot_ttl}","messagePattern":"Invalid value of auto_snapshot_ttl: (.+?)","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":632,"sourceCode":"    }\n\n    private static void applySimpleConfig()\n    {\n        //Doing this first before all other things in case other pieces of config want to construct\n        //InetAddressAndPort and get the right defaults\n        InetAddressAndPort.initializeDefaultPort(getStoragePort());\n\n        validateUpperBoundStreamingConfig();\n\n        if (conf.auto_snapshot_ttl != null)\n        {\n            try\n            {\n                autoSnapshoTtl = new DurationSpec.IntSecondsBound(conf.auto_snapshot_ttl);\n            }\n            catch (IllegalArgumentException e)\n            {\n                throw new ConfigurationException(\"Invalid value of auto_snapshot_ttl: \" + conf.auto_snapshot_ttl, false);\n            }\n        }\n\n        if (conf.commitlog_sync == null)\n        {\n            throw new ConfigurationException(\"Missing required directive CommitLogSync\", false);\n        }\n\n        if (conf.commitlog_sync == CommitLogSync.batch)\n        {\n            if (conf.commitlog_sync_period.toMilliseconds() != 0)\n            {\n                throw new ConfigurationException(\"Batch sync specified, but commitlog_sync_period found.\", false);\n            }\n            logger.debug(\"Syncing log with batch mode\");\n        }\n        else if (conf.commitlog_sync == CommitLogSync.group)\n        {","sourceCodeStart":614,"sourceCodeEnd":650,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L614-L650","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"# before (cassandra.yaml)\nauto_snapshot_ttl: 5hours\n# after\nauto_snapshot_ttl: 5h","handlingStrategy":"validation","validationCode":"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);","typeGuard":null,"tryCatchPattern":"try { DatabaseDescriptor.daemonInitialization(); } catch (ConfigurationException e) { log.error(\"auto_snapshot_ttl invalid: {}\", e.getMessage()); }","preventionTips":["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"],"tags":["cassandra","config","duration","validation"],"backgroundTag":"invalid-config-value","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}