{"record":{"id":"aafb6729955f29e1","repo":"apache/cassandra","slug":"local-system-data-file-directory-must-not-be-the-s-aafb67","errorCode":null,"errorMessage":"local_system_data_file_directory must not be the same as the saved_caches_directory","messagePattern":"local_system_data_file_directory must not be the same as the saved_caches_directory","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":910,"sourceCode":"            if (datadir.equals(conf.hints_directory))\n                throw new ConfigurationException(\"hints_directory must not be the same as any data_file_directories\", false);\n            if (datadir.equals(conf.saved_caches_directory))\n                throw new ConfigurationException(\"saved_caches_directory must not be the same as any data_file_directories\", false);\n\n            dataFreeBytes = saturatedSum(dataFreeBytes, tryGetSpace(datadir, FileStore::getUnallocatedSpace));\n        }\n        if (dataFreeBytes < 64 * ONE_GIB) // 64 GB\n            logger.warn(\"Only {} free across all data volumes. Consider adding more capacity to your cluster or removing obsolete snapshots\",\n                        FBUtilities.prettyPrintMemory(dataFreeBytes));\n\n        if (conf.local_system_data_file_directory != null)\n        {\n            if (conf.local_system_data_file_directory.equals(conf.commitlog_directory))\n                throw new ConfigurationException(\"local_system_data_file_directory must not be the same as the commitlog_directory\", false);\n            if (conf.local_system_data_file_directory.equals(conf.accord.journal_directory))\n                throw new ConfigurationException(\"local_system_data_file_directory must not be the same as the accord.journal_directory\", false);\n            if (conf.local_system_data_file_directory.equals(conf.saved_caches_directory))\n                throw new ConfigurationException(\"local_system_data_file_directory must not be the same as the saved_caches_directory\", false);\n            if (conf.local_system_data_file_directory.equals(conf.hints_directory))\n                throw new ConfigurationException(\"local_system_data_file_directory must not be the same as the hints_directory\", false);\n\n            long freeBytes = tryGetSpace(conf.local_system_data_file_directory, FileStore::getUnallocatedSpace);\n\n            if (freeBytes < ONE_GIB)\n                logger.warn(\"Only {} free in the system data volume. Consider adding more capacity or removing obsolete snapshots\",\n                            FBUtilities.prettyPrintMemory(freeBytes));\n        }\n\n        if (conf.commitlog_directory.equals(conf.accord.journal_directory))\n            throw new ConfigurationException(\"accord.journal_directory must not be the same as the commitlog_directory\", false);\n        if (conf.commitlog_directory.equals(conf.hints_directory))\n            throw new ConfigurationException(\"hints_directory must not be the same as the commitlog_directory\", false);\n        if (conf.commitlog_directory.equals(conf.saved_caches_directory))\n            throw new ConfigurationException(\"saved_caches_directory must not be the same as the commitlog_directory\", false);\n\n        if (conf.accord.journal_directory.equals(conf.hints_directory))","sourceCodeStart":892,"sourceCodeEnd":928,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L892-L928","documentation":"DatabaseDescriptor.applySimpleConfig throws this ConfigurationException when local_system_data_file_directory equals saved_caches_directory. The validation guarantees each dedicated directory (local system data, saved caches, commitlog, hints, accord journal) has its own path so that I/O and free-space checks per volume are meaningful.","triggerScenarios":"Set cassandra.yaml local_system_data_file_directory to the same path as saved_caches_directory and start the node; config is validated during toolInitialization/applyAll before any other startup work.","commonSituations":"Shared defaults in generated cassandra.yaml templates; Docker images where all data directories are flattened to a single volume path; operators who set only one custom path variable and reused it for multiple directory keys.","solutions":["Change saved_caches_directory (or local_system_data_file_directory) in cassandra.yaml to a distinct path.","Verify with a pre-startup script that all configured *_directory values are unique strings.","If saved caches can share the local-system volume by policy, still use distinct subdirectory paths to pass validation."],"exampleFix":"// before (cassandra.yaml)\nlocal_system_data_file_directory: /data/cassandra\nsaved_caches_directory: /data/cassandra\n// after\nlocal_system_data_file_directory: /data/cassandra/local_system\nsaved_caches_directory: /data/cassandra/saved_caches","handlingStrategy":"validation","validationCode":"if (cfg.local_system_data_file_directory != null && cfg.local_system_data_file_directory.equals(cfg.saved_caches_directory))\n    throw new IllegalArgumentException(\"local_system_data_file_directory must differ from saved_caches_directory\");","typeGuard":"boolean dirsDistinct(String a, String b) { return a == null || b == null || !new File(a).getAbsolutePath().equals(new File(b).getAbsolutePath()); }","tryCatchPattern":"try { DatabaseDescriptor.applyAll(cfg); } catch (ConfigurationException e) { logger.error(\"Directory collision: {}\", e.getMessage()); System.exit(1); }","preventionTips":["Keep saved_caches_directory pointing at its own path/subdirectory","Automate a uniqueness check across directory config keys before each deploy","Avoid copying one path variable into multiple directory keys in provisioning scripts"],"tags":["config","startup","directory-conflict"],"backgroundTag":"conflicting-config-options","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"}