{"record":{"id":"77657af58758104d","repo":"apache/cassandra","slug":"cdc-raw-directory-must-be-specified","errorCode":null,"errorMessage":"cdc_raw_directory must be specified","messagePattern":"cdc_raw_directory must be specified","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":2436,"sourceCode":"                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        {\n            throw new IllegalArgumentException(\"Bad configuration; unable to start server: \" + e.getMessage());\n        }\n        catch (FSWriteError e)\n        {\n            throw new IllegalStateException(e.getCause().getMessage() + \"; unable to start server\", e);\n        }","sourceCodeStart":2418,"sourceCodeEnd":2454,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L2418-L2454","documentation":"DatabaseDescriptor validates configuration during daemon initialization. When cdc_enabled is true but cdc_raw_directory is not set in cassandra.yaml, it throws a ConfigurationException that is later wrapped as IllegalArgumentException. CDC (Change Data Capture) needs a directory to write raw mutation logs.","triggerScenarios":"Starting Cassandra with cdc_enabled: true in cassandra.yaml but no cdc_raw_directory defined; programmatically calling DatabaseDescriptor.applyAll/daemonInit with such config.","commonSituations":"Users enabling CDC in a config file copied from an older version or a minimal template that lacks cdc_raw_directory; config merges dropping the key.","solutions":["Add cdc_raw_directory: /var/lib/cassandra/cdc_raw to cassandra.yaml","Or set cdc_enabled: false if CDC is not needed","Or pass the directory via system property -Dcassandra.cdc_raw_directory at startup"],"exampleFix":"// before (cassandra.yaml)\ncdc_enabled: true\n// after\ncdc_enabled: true\ncdc_raw_directory: /var/lib/cassandra/cdc_raw","handlingStrategy":"validation","validationCode":"Properties yaml = loadYaml(\"cassandra.yaml\");\nif (Boolean.parseBoolean(yaml.getProperty(\"cdc_enabled\")) && yaml.getProperty(\"cdc_raw_directory\") == null)\n    throw new IllegalStateException(\"cdc_enabled requires cdc_raw_directory to be set\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set cdc_raw_directory when cdc_enabled is true","Validate cassandra.yaml against the version's conf before deployment","Use config templates that include all CDC keys"],"tags":["config","cdc","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-17T15:17:12.973Z"}