{"record":{"id":"4aba768313c2f0ca","repo":"apache/cassandra","slug":"unable-to-determine-block-size-for-commit-log-dire","errorCode":null,"errorMessage":"Unable to determine block size for commit log directory: {}","messagePattern":"Unable to determine block size for commit log directory: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":1877,"sourceCode":"        {\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)\n                providedDiskAccessMode = DiskAccessMode.legacy;\n            else\n            {\n                providedDiskAccessMode = directIOSupported && conf.disk_optimization_strategy == Config.DiskOptimizationStrategy.ssd ? DiskAccessMode.direct\n                                                                                                                                     : DiskAccessMode.legacy;\n            }\n        }\n\n        if (providedDiskAccessMode == DiskAccessMode.legacy)\n        {\n            providedDiskAccessMode = compressOrEncrypt ? DiskAccessMode.standard : DiskAccessMode.mmap;\n        }","sourceCodeStart":1859,"sourceCodeEnd":1895,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L1859-L1895","documentation":"During startup, DatabaseDescriptor tries to determine the filesystem block size of the commit log directory to pick a sane disk access mode. If probing the disk throws a RuntimeException, Cassandra logs this warning and falls back to defaults instead of failing startup. It indicates the commit log device could not be stat-ed properly.","triggerScenarios":"callingDatabaseDescriptor.applyDiskAccessModeWithCommitLogSection() with a commit log directory that is missing, unreadable, or on an unusual filesystem so the block-size probe throws a RuntimeException (not IOError/ConfigurationException, which are rethrown).","commonSituations":"Commit log path pointing at a nonexistent directory, a bind-mounted or overlay filesystem (containers) where block-size detection fails, or permission problems on the commit log volume.","solutions":["Verify commitlog_directory exists, is writable by the cassandra user, and is on a normal filesystem","Explicitly set disk_access_mode in cassandra.yaml (e.g. mmap or standard) instead of auto so block-size detection is skipped","If the fallback behavior is acceptable, ignore the warning after confirming disk access mode defaults are fine"],"exampleFix":"// cassandra.yaml before\ndisk_access_mode: auto\n// after\ndisk_access_mode: mmap","handlingStrategy":"validation","validationCode":"File dir = new File(DatabaseDescriptor.getCommitLogLocation());\nif (!dir.exists() || !dir.canRead()) throw new IllegalStateException(\"Commit log dir unusable: \" + dir);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pre-create commitlog_directory with correct ownership before startup","Set disk_access_mode explicitly on container/overlay filesystems","Check mount type of the commit log volume (avoid FUSE/overlay when possible)"],"tags":["cassandra","configuration","filesystem","commitlog"],"backgroundTag":"missing-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"}