{"record":{"id":"5660a903b63d4212","repo":"apache/cassandra","slug":"invalid-configuration-heap-dump-is-enabled-but-ca","errorCode":null,"errorMessage":"Invalid configuration. Heap dump is enabled but cannot create heap dump output path: %s.","messagePattern":"Invalid configuration\\. Heap dump is enabled but cannot create heap dump output path: (.+?)\\.","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":1248,"sourceCode":"        {\n            throw new ConfigurationException(String.format(\"default_keyspace_rf (%d) cannot be less than minimum_replication_factor_fail_threshold (%d)\",\n                                                           conf.default_keyspace_rf, conf.minimum_replication_factor_fail_threshold));\n        }\n\n        if (conf.paxos_repair_parallelism <= 0)\n            conf.paxos_repair_parallelism = Math.max(1, conf.concurrent_writes / 8);\n\n        Paxos.setPaxosVariant(conf.paxos_variant);\n        if (conf.paxos_state_purging == null)\n            conf.paxos_state_purging = PaxosStatePurging.legacy;\n\n        logInitializationOutcome(logger);\n\n        if (conf.max_space_usable_for_compactions_in_percentage < 0 || conf.max_space_usable_for_compactions_in_percentage > 1)\n            throw new ConfigurationException(\"max_space_usable_for_compactions_in_percentage must be between 0 and 1\", false);\n\n        if (conf.dump_heap_on_uncaught_exception && DatabaseDescriptor.getHeapDumpPath() == null)\n            throw new ConfigurationException(String.format(\"Invalid configuration. Heap dump is enabled but cannot create heap dump output path: %s.\", conf.heap_dump_path != null ? conf.heap_dump_path : \"null\"));\n\n        conf.sai_options.validate();\n\n        List<ConsistencyLevel> progressBarrierCLsArr = Arrays.asList(ALL, EACH_QUORUM, LOCAL_QUORUM, QUORUM, ONE, NODE_LOCAL);\n        Set<ConsistencyLevel> progressBarrierCls = new HashSet<>(progressBarrierCLsArr);\n        if (!progressBarrierCls.contains(conf.progress_barrier_min_consistency_level))\n        {\n            throw new ConfigurationException(String.format(\"Invalid value for progress_barrier_min_consistency_level %s. Allowed values: %s\",\n                                                           conf.progress_barrier_min_consistency_level, progressBarrierCLsArr));\n        }\n\n        if (!progressBarrierCls.contains(conf.progress_barrier_default_consistency_level))\n        {\n            throw new ConfigurationException(String.format(\"Invalid value for.progress_barrier_default_consistency_level %s. Allowed values: %s\",\n                                                           conf.progress_barrier_default_consistency_level, progressBarrierCLsArr));\n        }\n\n        if (conf.native_transport_min_backoff_on_queue_overload.toMilliseconds() <= 0)","sourceCodeStart":1230,"sourceCodeEnd":1266,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L1230-L1266","documentation":"When dump_heap_on_uncaught_exception is enabled, Cassandra must be able to resolve a writable heap dump output path. DatabaseDescriptor throws this ConfigurationException when the heap dump path is unset (getHeapDumpPath() returns null) or cannot be created, so an OOM crash could not produce the requested dump.","triggerScenarios":"applySimpleConfig (via toolInitialization/applyAll) with dump_heap_on_uncaught_exception=true and heap_dump_path unset or pointing to an uncreatable location.","commonSituations":"Enabling heap dumps in a container without a writable volume for the dump path; forgetting to set heap_dump_path; path pointing to a read-only mount.","solutions":["Set heap_dump_path in cassandra.yaml to a writable directory/file path","Ensure the Cassandra process user has write permission to the directory and enough disk space","Disable dump_heap_on_uncaught_exception if heap dumps are not needed"],"exampleFix":"// before (cassandra.yaml)\ndump_heap_on_uncaught_exception: true\n# heap_dump_path not set\n// after\ndump_heap_on_uncaught_exception: true\nheap_dump_path: /var/lib/cassandra/heapdump.hprof","handlingStrategy":"validation","validationCode":"if (conf.dump_heap_on_uncaught_exception) { java.nio.file.Path p = java.nio.file.Paths.get(conf.heap_dump_path != null ? conf.heap_dump_path : \"./heapdump.hprof\"); java.nio.file.Files.createDirectories(p.toAbsolutePath().getParent()); if (!java.nio.file.Files.isWritable(p.toAbsolutePath().getParent())) throw new IllegalStateException(\"heap dump path not writable\"); }","typeGuard":null,"tryCatchPattern":"try { DatabaseDescriptor.toolInitialization(); } catch (ConfigurationException e) { log.error(\"Heap dump path invalid: {}\", e.getMessage()); }","preventionTips":["Always set heap_dump_path when enabling dump_heap_on_uncaught_exception","Point the path at a writable persistent volume, especially in containers","Check free disk space for dumps"],"tags":["cassandra","configuration","heap-dump"],"backgroundTag":"invalid-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"}