{"record":{"id":"e13352feac76dc5c","repo":"apache/cassandra","slug":"found-unknown-system-directory-at-this","errorCode":null,"errorMessage":"Found unknown system directory {}.{} at {} - this is likely left over from a previous version of Cassandra and should be removed after inspection.","messagePattern":"Found unknown system directory (.+?)\\.(.+?) at (.+?) - this is likely left over from a previous version of Cassandra and should be removed after inspection\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/service/StartupChecks.java","lineNumber":1001,"sourceCode":"\n                        // In very old versions of Cassandra, we wouldn't necessarily delete sstables from dropped system tables\n                        // which were removed in various major version upgrades (e.g system.Versions in 1.2)\n                        if (ksPart.equals(SchemaConstants.SYSTEM_KEYSPACE_NAME) && !SystemKeyspace.ALL_TABLE_NAMES.contains(tablePart))\n                        {\n                            String canonicalPath = FileUtils.getCanonicalPath(new File(dir));\n\n                            // We can have snapshots of our system tables or snapshots created with a -t tag of \"system\" that would trigger\n                            // this potential warning, so we warn more softly in the case that it's probably a snapshot.\n                            if (canonicalPath.contains(\"snapshot\"))\n                            {\n                                logger.info(\"Found unknown system directory {}.{} at {} that contains the word snapshot. \" +\n                                            \"This may be left over from a previous version of Cassandra or may be normal. \" +\n                                            \" Consider removing after inspection if determined to be unnecessary.\",\n                                            ksPart, tablePart, canonicalPath);\n                            }\n                            else\n                            {\n                                logger.warn(\"Found unknown system directory {}.{} at {} - this is likely left over from a previous \" +\n                                            \"version of Cassandra and should be removed after inspection.\",\n                                            ksPart, tablePart, canonicalPath);\n                            }\n                            return FileVisitResult.SKIP_SUBTREE;\n                        }\n                    }\n\n                    String name = dir.getFileName().toString();\n                    return (name.equals(Directories.SNAPSHOT_SUBDIR)\n                            || name.equals(Directories.BACKUPS_SUBDIR)\n                            || nonSSTablePaths.contains(PathUtils.toCanonicalPath(dir).toString()))\n                           ? FileVisitResult.SKIP_SUBTREE\n                           : FileVisitResult.CONTINUE;\n                }\n            };\n\n            for (String dataDir : DatabaseDescriptor.getAllDataFileLocations())\n            {","sourceCodeStart":983,"sourceCodeEnd":1019,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/StartupChecks.java#L983-L1019","documentation":"During startup Cassandra walks the data directories and validates that every keyspace/table subdirectory belongs to a known system table. Directories under the 'system' keyspace that are not recognized are warned as likely leftovers from a previous Cassandra version, while unknown non-system directories get a softer message. This catches stale metadata (e.g. from a botched upgrade) that could confuse schema handling.","triggerScenarios":"A directory under the data dir matches a 'system'-keyspace table name that the current version does not recognize (e.g. after downgrade or partial upgrade), triggering the warn in the Files.walkFileTree visitor with SKIP_SUBTREE.","commonSituations":"Upgrading from an older Cassandra version where a system table was removed; a downgrade left system table data behind; manual copying of data dirs between clusters/versions.","solutions":["Back up, then inspect the flagged directory contents before deleting","If confirmed leftover from an old version, remove the directory while the node is stopped","Verify schema upgraded cleanly (check system_schema tables); run upgradesstables if needed","If the directory holds needed data, use sstableloader to re-import it into a current table"],"exampleFix":"// before (node stopped)\n/var/lib/cassandra/data/system/local-abc123/   # unknown system table\n\n// after\n$ cp -r /var/lib/cassandra/data/system/local-abc123 /backup/\n$ rm -rf /var/lib/cassandra/data/system/local-abc123\n$ .build/build-jars.sh -s && bin/cassandra   # restart, warning gone","handlingStrategy":"fallback","validationCode":"// before upgrade: list system dirs and compare with known system tables\nls /var/lib/cassandra/data/system/ | while read d; do\n  echo \"$d\"; # diff against system_schema tables of target version\n","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never downgrade Cassandra in place; snapshot data dirs first","Follow the documented upgrade procedure including upgradesstables","Back up the data directory before any version change"],"tags":["startup","upgrade","filesystem","system-keyspace"],"backgroundTag":"stale-filesystem-artifact","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"}