{"record":{"id":"5b8f1bafbd19d958","repo":"apache/cassandra","slug":"missing-required-directive-commitlogsync","errorCode":null,"errorMessage":"Missing required directive CommitLogSync","messagePattern":"Missing required directive CommitLogSync","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"critical","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":638,"sourceCode":"        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        {\n            if (conf.commitlog_sync_group_window.toMilliseconds() == 0)\n            {\n                throw new ConfigurationException(\"Missing value for commitlog_sync_group_window.\", false);\n            }\n            else if (conf.commitlog_sync_period.toMilliseconds() != 0)\n            {","sourceCodeStart":620,"sourceCodeEnd":656,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L620-L656","documentation":"commitlog_sync is a required directive in cassandra.yaml; Cassandra refuses to start if it is unset. The sync mode (periodic, batch, group) determines how writes are acknowledged by the commit log, so it must be explicitly configured.","triggerScenarios":"DatabaseDescriptor.applySimpleConfig finds conf.commitlog_sync == null during startup (applyAll) or tool initialization because cassandra.yaml omits the commitlog_sync directive.","commonSituations":"Minimal/hand-written cassandra.yaml missing the directive, an upgrade where the option was removed from the file, or a template config stripped down too far.","solutions":["Add 'commitlog_sync: periodic' (or 'batch'/'group') to cassandra.yaml","When using 'periodic', also set commitlog_sync_period_in_ms; for 'batch' ensure the period is 0/absent","Compare against the shipped cassandra.yaml template and restore any missing required directives"],"exampleFix":"# before (cassandra.yaml)\n# commitlog_sync directive missing\n# after\ncommitlog_sync: periodic\ncommitlog_sync_period_in_ms: 10000","handlingStrategy":"validation","validationCode":"if (yaml.get(\"commitlog_sync\") == null) throw new IllegalStateException(\"cassandra.yaml missing required commitlog_sync\");","typeGuard":null,"tryCatchPattern":"try { DatabaseDescriptor.daemonInitialization(); } catch (ConfigurationException e) { log.error(\"missing required directive: {}\", e.getMessage()); System.exit(1); }","preventionTips":["Start from the stock cassandra.yaml when upgrading","Keep required directives (commitlog_sync, partitioner, endpoint_snitch) in all config templates","Diff your yaml against the version's conf template on upgrade"],"tags":["cassandra","config","commitlog","startup"],"backgroundTag":"missing-required-config-field","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}