apache/cassandra · error · StartupException

ERR_WRONG_MACHINE_STATE

ERR_WRONG_MACHINE_STATE

Error message

Failed to determine file system type for path ${path}

What it means

The filesystem-type startup check enumerates each data/metadata path, calls Files.getFileStore(path).type(), and this I/O fails with an IOException. Because the check cannot determine the filesystem type, it aborts startup with ERR_WRONG_MACHINE_STATE rather than skipping a safety check.

Solutions

  1. Verify the path exists and its filesystem is mounted before starting Cassandra (df -h <path>)
  2. Fix permissions so the Cassandra user can stat the filestore
  3. Remove the path from cassandra.yaml data directories if it is no longer used
  4. Suppress only if false positive by adjusting the check configuration — but prefer fixing the mount

Example fix

# before: data_file_directories includes /mnt/old_data (not mounted)
# after
mount /dev/nvme1n1 /mnt/old_data   # or remove the entry from cassandra.yaml
Defensive patterns

Strategy: validation

Validate before calling

for p in data_dirs: test -d "$p" && df "$p" >/dev/null || exit 1   # run before starting Cassandra

Prevention

When it happens

Trigger: execute() iterates candidate paths with direct IO enabled; Files.getFileStore(path) throws IOException for a path (unmounted volume, permission problem, stale mount, NFS oddity).

Common situations: Data directory on a volume that was not mounted before startup, path removed between listing and getFileStore, insufficient permissions to stat the mount, broken auto-mount/overlay setups in containers.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


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

Appendix: source

Thrown at src/java/org/apache/cassandra/service/StartupChecks.java:280

            if (!directIOWritePaths.isEmpty() && IGNORE_KERNEL_BUG_1057843_CHECK.getBoolean())
            {
                logger.info("Ignoring check for the kernel bug 1057843 against the following paths configured to be accessed with Direct IO: {}", directIOWritePaths);
                return;
            }

            Set<String> affectedFileSystemTypes = Set.of("ext4");
            Set<Path> affectedPaths = new HashSet<>();
            for (Path path : directIOWritePaths)
            {
                try
                {
                    if (affectedFileSystemTypes.contains(toLowerCaseLocalized(Files.getFileStore(path).type())))
                        affectedPaths.add(path);
                }
                catch (IOException e)
                {
                    throw new StartupException(StartupException.ERR_WRONG_MACHINE_STATE, "Failed to determine file system type for path " + path, e);
                }
            }

            if (affectedPaths.isEmpty())
                return;

            Range<Semver> affectedKernels = Range.closedOpen(new Semver("6.1.64", Semver.SemverType.LOOSE),
                                                             new Semver("6.1.66", Semver.SemverType.LOOSE));

            Semver kernelVersion = FBUtilities.getKernelVersion();
            if (!affectedKernels.contains(kernelVersion.withClearedSuffixAndBuild()))
                return;

            throw new StartupException(StartupException.ERR_WRONG_MACHINE_STATE,
                                       String.format("Detected kernel version %s with affected file system types %s and direct IO enabled for paths %s. " +
                                                     "This combination is known to cause data corruption. To start Cassandra in this environment, " +
                                                     "you have to disable direct IO for the affected paths. If you are sure the verification provided " +
                                                     "a false positive result, you can suppress it by setting '" + IGNORE_KERNEL_BUG_1057843_CHECK.getKey() + "' system property to 'true'. " +

View on GitHub (pinned to 88fd0f6a0e)