{"record":{"id":"c367f2147dcb7c62","repo":"apache/cassandra","slug":"commitlog-directory-must-be-specified","errorCode":null,"errorMessage":"commitlog_directory must be specified","messagePattern":"commitlog_directory must be specified","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"critical","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":1865,"sourceCode":"            throw new ConfigurationException(\"Invalid partitioner class \" + name, e);\n        }\n\n        partitionerName = partitioner.getClass().getCanonicalName();\n    }\n\n    private static Pair<DiskAccessMode, Boolean> resolveCommitLogWriteDiskAccessMode(DiskAccessMode providedDiskAccessMode)\n    {\n        boolean compressOrEncrypt = getCommitLogCompression() != null || (getEncryptionContext() != null && getEncryptionContext().isEnabled());\n        boolean directIOSupported = false;\n        // File.getBlockSize creates directories/files tools may not have permissions for\n        if (!toolInitialized)\n        {\n            try\n            {\n                String commitLogLocation = getCommitLogLocation();\n\n                if (commitLogLocation == null)\n                    throw new ConfigurationException(\"commitlog_directory must be specified\", false);\n\n                File commitLogLocationDir = new File(commitLogLocation);\n                PathUtils.createDirectoriesIfNotExists(commitLogLocationDir.toPath());\n                directIOSupported = FileUtils.isDirectIOSupported(commitLogLocationDir);\n            }\n            catch (IOError | ConfigurationException ex)\n            {\n                throw ex;\n            }\n            catch (RuntimeException e)\n            {\n                logger.warn(\"Unable to determine block size for commit log directory: {}\", e.getMessage());\n            }\n        }\n\n        if (providedDiskAccessMode == DiskAccessMode.auto)\n        {\n            if (compressOrEncrypt)","sourceCodeStart":1847,"sourceCodeEnd":1883,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L1847-L1883","documentation":"At startup DatabaseDescriptor resolves the commit log directory, and if commitlog_directory is unset the location string is null — a node cannot run without a place to write its commit log, so a ConfigurationException is thrown. It then creates the directory and probes the filesystem for Direct IO support.","triggerScenarios":"cassandra.yaml has no commitlog_directory value (null) when config validation calls getCommitLogLocation(); thrown before any data directories are touched.","commonSituations":"Minimal or generated cassandra.yaml missing commitlog_directory; a config templating tool rendering the key empty; typo like commit_log_directory.","solutions":["Add commitlog_directory: /var/lib/cassandra/commitlog (or your desired path) to cassandra.yaml","Verify the key spelling matches commitlog_directory exactly","Ensure the account running Cassandra has write permission on the configured path once set"],"exampleFix":"# before (cassandra.yaml)\n# commitlog_directory missing\n# after\ncommitlog_directory: /var/lib/cassandra/commitlog","handlingStrategy":"validation","validationCode":"if (yaml.get(\"commitlog_directory\") == null) throw new IllegalStateException(\"set commitlog_directory\");","typeGuard":null,"tryCatchPattern":"try { DatabaseDescriptor.daemonInitialization(); } catch (ConfigurationException e) { /* set commitlog_directory */ }","preventionTips":["Include commitlog_directory in every yaml"],"tags":["configuration","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-14T16:17:12.679Z"}