apache/cassandra · critical · ConfigurationException

local_system_data_file_directory must not be the same as any

Error message

local_system_data_file_directory must not be the same as any data_file_directories

What it means

Cassandra requires conf.local_system_data_file_directory (where local system keyspaces' data is stored) to differ from every entry in data_file_directories. applySimpleConfig throws ConfigurationException when they collide, preventing ambiguous data placement between the local system directory and regular data directories.

Source

Thrown at src/java/org/apache/cassandra/config/DatabaseDescriptor.java:887

        }

        if (conf.saved_caches_directory == null)
        {
            conf.saved_caches_directory = storagedirFor("saved_caches");
        }
        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))

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Choose a distinct path for local_system_data_file_directory (e.g. /var/lib/cassandra/local_system)
  2. Remove local_system_data_file_directory entirely if separation is not desired (it is optional)
  3. Check each data_file_directories entry for exact string equality against the local system directory

Example fix

# before (cassandra.yaml)
data_file_directories:
  - /var/lib/cassandra/data
local_system_data_file_directory: /var/lib/cassandra/data
# after (cassandra.yaml)
data_file_directories:
  - /var/lib/cassandra/data
local_system_data_file_directory: /var/lib/cassandra/local_system
Defensive patterns

Strategy: validation

Validate before calling

String local = (String) yaml.get("local_system_data_file_directory");
List<String> dirs = (List<String>) yaml.get("data_file_directories");
if (local != null && dirs != null && dirs.contains(local))
    throw new IllegalArgumentException("local_system_data_file_directory must differ from all data_file_directories");

Try / catch

try {
    DatabaseDescriptor.toolInitialization();
} catch (ConfigurationException e) {
    if (e.getMessage().contains("local_system_data_file_directory"))
        throw new StartupConfigError("directory collision with data_file_directories", e);
    throw e;
}

Prevention

When it happens

Trigger: Setting local_system_data_file_directory in cassandra.yaml to a path equal (string equality) to any data_file_directories entry; checked during applySimpleConfig on every startup.

Common situations: Operators consolidating directories on small disks and pointing local system data at the main data dir; config generators defaulting both to the same path.

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


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/1ae55854ce3af3ae. Report an issue: GitHub.