apache/cassandra · critical · ConfigurationException
hints_directory must not be the same as any data_file_direct
Error message
hints_directory must not be the same as any data_file_directories
What it means
hints_directory stores hinted handoff data and must be distinct from all data_file_directories. applySimpleConfig throws ConfigurationException if any data directory string-equals conf.hints_directory, preventing the node from starting with hints written into SSTable directories.
Source
Thrown at src/java/org/apache/cassandra/config/DatabaseDescriptor.java:893
if (conf.data_file_directories == null || conf.data_file_directories.length == 0)
{
conf.data_file_directories = new String[]{ storagedir("data_file_directories") + File.pathSeparator() + "data" };
}
long dataFreeBytes = 0;
/* data file and commit log directories. they get created later, when they're needed. */
for (String datadir : conf.data_file_directories)
{
if (datadir == null)
throw new ConfigurationException("data_file_directories must not contain empty entry", false);
if (datadir.equals(conf.local_system_data_file_directory))
throw new ConfigurationException("local_system_data_file_directory must not be the same as any data_file_directories", false);
if (datadir.equals(conf.commitlog_directory))
throw new ConfigurationException("commitlog_directory must not be the same as any data_file_directories", false);
if (datadir.equals(conf.accord.journal_directory))
throw new ConfigurationException("accord.journal_directory must not be the same as any data_file_directories", false);
if (datadir.equals(conf.hints_directory))
throw new ConfigurationException("hints_directory must not be the same as any data_file_directories", false);
if (datadir.equals(conf.saved_caches_directory))
throw new ConfigurationException("saved_caches_directory must not be the same as any data_file_directories", false);
dataFreeBytes = saturatedSum(dataFreeBytes, tryGetSpace(datadir, FileStore::getUnallocatedSpace));
}
if (dataFreeBytes < 64 * ONE_GIB) // 64 GB
logger.warn("Only {} free across all data volumes. Consider adding more capacity to your cluster or removing obsolete snapshots",
FBUtilities.prettyPrintMemory(dataFreeBytes));
if (conf.local_system_data_file_directory != null)
{
if (conf.local_system_data_file_directory.equals(conf.commitlog_directory))
throw new ConfigurationException("local_system_data_file_directory must not be the same as the commitlog_directory", false);
if (conf.local_system_data_file_directory.equals(conf.accord.journal_directory))
throw new ConfigurationException("local_system_data_file_directory must not be the same as the accord.journal_directory", false);
if (conf.local_system_data_file_directory.equals(conf.saved_caches_directory))
throw new ConfigurationException("local_system_data_file_directory must not be the same as the saved_caches_directory", false);
if (conf.local_system_data_file_directory.equals(conf.hints_directory))View on GitHub (pinned to 88fd0f6a0e)
Solutions
- Set hints_directory to a distinct path (e.g. /var/lib/cassandra/hints)
- Use a sibling subdirectory of the data volume if disk sharing is intended, never the exact data directory
- Re-run config validation after any directory migration
Example fix
# before (cassandra.yaml) data_file_directories: - /var/lib/cassandra/data hints_directory: /var/lib/cassandra/data # after (cassandra.yaml) data_file_directories: - /var/lib/cassandra/data hints_directory: /var/lib/cassandra/hints
Defensive patterns
Strategy: validation
Validate before calling
String hints = (String) yaml.get("hints_directory");
List<String> dirs = (List<String>) yaml.get("data_file_directories");
if (hints != null && dirs != null && dirs.contains(hints))
throw new IllegalArgumentException("hints_directory must differ from all data_file_directories"); Try / catch
try {
DatabaseDescriptor.toolInitialization();
} catch (ConfigurationException e) {
if (e.getMessage().contains("hints_directory"))
throw new StartupConfigError("hints_directory overlaps a data directory", e);
throw e;
} Prevention
- Keep hints in its own directory (e.g. /var/lib/cassandra/hints)
- Run directory-uniqueness linting on generated configs
- Re-validate after any storage layout migration
When it happens
Trigger: Setting hints_directory in cassandra.yaml equal to any data_file_directories entry; validated during DatabaseDescriptor initialization (applySimpleConfig via toolInitialization/applyAll).
Common situations: Consolidated-directory deployments; config generators that assign one base path to all directory settings; operators moving hints onto the data disk without adjusting the path to a subdirectory.
Understand the failure class
Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.
Related errors
- data_file_directories must not contain empty entry
- local_system_data_file_directory must not be the same as any
- commitlog_directory must not be the same as any data_file_di
- accord.journal_directory must not be the same as any data_fi
- saved_caches_directory must not be the same as any data_file
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/7afd61cb3022b15c.
Report an issue: GitHub.