{"record":{"id":"b55a21a31464a386","repo":"apache/cassandra","slug":"saved-caches-directory-must-be-specified","errorCode":null,"errorMessage":"saved_caches_directory must be specified","messagePattern":"saved_caches_directory must be specified","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"critical","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":2430,"sourceCode":"                FileUtils.createDirectory(dataFileDirectory);\n\n            if (conf.local_system_data_file_directory != null)\n                FileUtils.createDirectory(conf.local_system_data_file_directory);\n\n            if (conf.commitlog_directory == null)\n                throw new ConfigurationException(\"commitlog_directory must be specified\", false);\n            FileUtils.createDirectory(conf.commitlog_directory);\n\n            if (conf.accord.journal_directory == null)\n                throw new ConfigurationException(\"accord.journal_directory must be specified\", false);\n            FileUtils.createDirectory(conf.accord.journal_directory);\n\n            if (conf.hints_directory == null)\n                throw new ConfigurationException(\"hints_directory must be specified\", false);\n            FileUtils.createDirectory(conf.hints_directory);\n\n            if (conf.saved_caches_directory == null)\n                throw new ConfigurationException(\"saved_caches_directory must be specified\", false);\n            FileUtils.createDirectory(conf.saved_caches_directory);\n\n            if (conf.cdc_enabled)\n            {\n                if (conf.cdc_raw_directory == null)\n                    throw new ConfigurationException(\"cdc_raw_directory must be specified\", false);\n                FileUtils.createDirectory(conf.cdc_raw_directory);\n            }\n\n            boolean created = maybeCreateHeapDumpPath();\n            if (!created && conf.dump_heap_on_uncaught_exception)\n            {\n                logger.error(String.format(\"cassandra.yaml:dump_heap_on_uncaught_exception is enabled but unable to create heap dump path %s. Disabling.\", conf.heap_dump_path != null ? conf.heap_dump_path : \"null\"));\n                conf.dump_heap_on_uncaught_exception = false;\n            }\n        }\n        catch (ConfigurationException e)\n        {","sourceCodeStart":2412,"sourceCodeEnd":2448,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L2412-L2448","documentation":"createAllDirectories validates that conf.saved_caches_directory is configured before creating it; saved caches (key/save cache persistence) need a directory, and an unset value throws this ConfigurationException during node startup.","triggerScenarios":"cassandra.yaml lacks saved_caches_directory (or it is null in a programmatic Config) when createAllDirectories runs; typically right after the hints_directory check passes.","commonSituations":"Over-aggressive config pruning for container images; config copied from a minimal/older setup; typo such as saved_cache_directory (singular) that leaves the real key unset.","solutions":["Add saved_caches_directory to cassandra.yaml (e.g. /var/lib/cassandra/saved_caches)","Verify the exact key spelling (saved_caches_directory) in the yaml","In programmatic setups, set Config.saved_caches_directory before DatabaseDescriptor initialization"],"exampleFix":"// before (cassandra.yaml)\n# saved_caches_directory not set\n// after\nsaved_caches_directory: /var/lib/cassandra/saved_caches","handlingStrategy":"validation","validationCode":"if (conf.saved_caches_directory == null)\n    throw new IllegalArgumentException(\"saved_caches_directory is required\");","typeGuard":null,"tryCatchPattern":"try { DatabaseDescriptor.daemonInitialization(); }\ncatch (ConfigurationException e) {\n    if (e.getMessage().equals(\"saved_caches_directory must be specified\"))\n        fixYamlAndRestart();\n}","preventionTips":["Spell the key exactly as saved_caches_directory","Include it in the same template block as data/commitlog/hints directories","Run config validation (dry init) before rollout"],"tags":["configuration","caches","cassandra-yaml"],"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-17T15:17:12.973Z"}