apache/cassandra · critical · ConfigurationException

commitlog_directory must be specified

Error message

commitlog_directory must be specified

What it means

At startup DatabaseDescriptor resolves the commit log directory, and if commitlog_directory is unset the location string is null — a node cannot run without a place to write its commit log, so a ConfigurationException is thrown. It then creates the directory and probes the filesystem for Direct IO support.

Source

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

            throw new ConfigurationException("Invalid partitioner class " + name, e);
        }

        partitionerName = partitioner.getClass().getCanonicalName();
    }

    private static Pair<DiskAccessMode, Boolean> resolveCommitLogWriteDiskAccessMode(DiskAccessMode providedDiskAccessMode)
    {
        boolean compressOrEncrypt = getCommitLogCompression() != null || (getEncryptionContext() != null && getEncryptionContext().isEnabled());
        boolean directIOSupported = false;
        // File.getBlockSize creates directories/files tools may not have permissions for
        if (!toolInitialized)
        {
            try
            {
                String commitLogLocation = getCommitLogLocation();

                if (commitLogLocation == null)
                    throw new ConfigurationException("commitlog_directory must be specified", false);

                File commitLogLocationDir = new File(commitLogLocation);
                PathUtils.createDirectoriesIfNotExists(commitLogLocationDir.toPath());
                directIOSupported = FileUtils.isDirectIOSupported(commitLogLocationDir);
            }
            catch (IOError | ConfigurationException ex)
            {
                throw ex;
            }
            catch (RuntimeException e)
            {
                logger.warn("Unable to determine block size for commit log directory: {}", e.getMessage());
            }
        }

        if (providedDiskAccessMode == DiskAccessMode.auto)
        {
            if (compressOrEncrypt)

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Add commitlog_directory: /var/lib/cassandra/commitlog (or your desired path) to cassandra.yaml
  2. Verify the key spelling matches commitlog_directory exactly
  3. Ensure the account running Cassandra has write permission on the configured path once set

Example fix

# before (cassandra.yaml)
# commitlog_directory missing
# after
commitlog_directory: /var/lib/cassandra/commitlog
Defensive patterns

Strategy: validation

Validate before calling

if (yaml.get("commitlog_directory") == null) throw new IllegalStateException("set commitlog_directory");

Try / catch

try { DatabaseDescriptor.daemonInitialization(); } catch (ConfigurationException e) { /* set commitlog_directory */ }

Prevention

When it happens

Trigger: cassandra.yaml has no commitlog_directory value (null) when config validation calls getCommitLogLocation(); thrown before any data directories are touched.

Common situations: Minimal or generated cassandra.yaml missing commitlog_directory; a config templating tool rendering the key empty; typo like commit_log_directory.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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