{"record":{"id":"0c15cad7a535a10a","repo":"apache/cassandra","slug":"err-wrong-machine-state-0c15ca","errorCode":"ERR_WRONG_MACHINE_STATE","errorMessage":"Failed to determine file system type for path ${path}","messagePattern":"Failed to determine file system type for path (.+?)","errorType":"error_code","errorClass":"StartupException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/StartupChecks.java","lineNumber":280,"sourceCode":"\n            if (!directIOWritePaths.isEmpty() && IGNORE_KERNEL_BUG_1057843_CHECK.getBoolean())\n            {\n                logger.info(\"Ignoring check for the kernel bug 1057843 against the following paths configured to be accessed with Direct IO: {}\", directIOWritePaths);\n                return;\n            }\n\n            Set<String> affectedFileSystemTypes = Set.of(\"ext4\");\n            Set<Path> affectedPaths = new HashSet<>();\n            for (Path path : directIOWritePaths)\n            {\n                try\n                {\n                    if (affectedFileSystemTypes.contains(toLowerCaseLocalized(Files.getFileStore(path).type())))\n                        affectedPaths.add(path);\n                }\n                catch (IOException e)\n                {\n                    throw new StartupException(StartupException.ERR_WRONG_MACHINE_STATE, \"Failed to determine file system type for path \" + path, e);\n                }\n            }\n\n            if (affectedPaths.isEmpty())\n                return;\n\n            Range<Semver> affectedKernels = Range.closedOpen(new Semver(\"6.1.64\", Semver.SemverType.LOOSE),\n                                                             new Semver(\"6.1.66\", Semver.SemverType.LOOSE));\n\n            Semver kernelVersion = FBUtilities.getKernelVersion();\n            if (!affectedKernels.contains(kernelVersion.withClearedSuffixAndBuild()))\n                return;\n\n            throw new StartupException(StartupException.ERR_WRONG_MACHINE_STATE,\n                                       String.format(\"Detected kernel version %s with affected file system types %s and direct IO enabled for paths %s. \" +\n                                                     \"This combination is known to cause data corruption. To start Cassandra in this environment, \" +\n                                                     \"you have to disable direct IO for the affected paths. If you are sure the verification provided \" +\n                                                     \"a false positive result, you can suppress it by setting '\" + IGNORE_KERNEL_BUG_1057843_CHECK.getKey() + \"' system property to 'true'. \" +","sourceCodeStart":262,"sourceCodeEnd":298,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/StartupChecks.java#L262-L298","documentation":"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.","triggerScenarios":"execute() iterates candidate paths with direct IO enabled; Files.getFileStore(path) throws IOException for a path (unmounted volume, permission problem, stale mount, NFS oddity).","commonSituations":"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.","solutions":["Verify the path exists and its filesystem is mounted before starting Cassandra (df -h <path>)","Fix permissions so the Cassandra user can stat the filestore","Remove the path from cassandra.yaml data directories if it is no longer used","Suppress only if false positive by adjusting the check configuration — but prefer fixing the mount"],"exampleFix":"# before: data_file_directories includes /mnt/old_data (not mounted)\n# after\nmount /dev/nvme1n1 /mnt/old_data   # or remove the entry from cassandra.yaml","handlingStrategy":"validation","validationCode":"for p in data_dirs: test -d \"$p\" && df \"$p\" >/dev/null || exit 1   # run before starting Cassandra","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Add mount checks to the service unit (ExecStartPre)","Ensure volumes mount before Cassandra starts","Keep cassandra.yaml data directories aligned with actual mounts"],"tags":["filesystem","startup","io"],"backgroundTag":"file-read-failed","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}