{"record":{"id":"411bc9fe13791764","repo":"apache/cassandra","slug":"can-t-open-incompatible-sstable-current-version","errorCode":null,"errorMessage":"Can't open incompatible SSTable! Current version %s, found file: %s","messagePattern":"Can't open incompatible SSTable! Current version (.+?), found file: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/io/sstable/format/SSTableReader.java","lineNumber":1869,"sourceCode":"        @Override\n        public final boolean equals(Object o)\n        {\n            if (!(o instanceof IndexesBounds))\n                return false;\n            IndexesBounds that = (IndexesBounds) o;\n            return lowerPosition == that.lowerPosition && upperPosition == that.upperPosition;\n        }\n    }\n\n    /**\n     * Moves the sstable in oldDescriptor to a new place (with generation etc) in newDescriptor.\n     * <p>\n     * All components given will be moved/renamed\n     */\n    public static SSTableReader moveAndOpenSSTable(ColumnFamilyStore cfs, Descriptor oldDescriptor, Descriptor newDescriptor, Set<Component> components, boolean copyData)\n    {\n        if (!oldDescriptor.isCompatible())\n            throw new RuntimeException(String.format(\"Can't open incompatible SSTable! Current version %s, found file: %s\",\n                                                     oldDescriptor.getFormat().getLatestVersion(),\n                                                     oldDescriptor));\n\n        boolean isLive = cfs.getLiveSSTables().stream().anyMatch(r -> r.descriptor.equals(newDescriptor)\n                                                                      || r.descriptor.equals(oldDescriptor));\n        if (isLive)\n        {\n            String message = String.format(\"Can't move and open a file that is already in use in the table %s -> %s\", oldDescriptor, newDescriptor);\n            logger.error(message);\n            throw new RuntimeException(message);\n        }\n        if (newDescriptor.fileFor(Components.DATA).exists())\n        {\n            String msg = String.format(\"File %s already exists, can't move the file there\", newDescriptor.fileFor(Components.DATA));\n            logger.error(msg);\n            throw new RuntimeException(msg);\n        }\n","sourceCodeStart":1851,"sourceCodeEnd":1887,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/io/sstable/format/SSTableReader.java#L1851-L1887","documentation":"moveAndOpenSSTable() refuses to move/open an SSTable whose descriptor version is not compatible with the currently supported format. It throws a RuntimeException naming the latest supported version and the offending file, preventing opening of SSTables written by incompatible Cassandra versions or formats.","triggerScenarios":"Calling moveAndOpenSSTable (e.g. during sstable upgrade/relocation or offline tools) with oldDescriptor whose version fails isCompatible() — typically SSTables from an older major version no longer supported, or foreign/exotic formats.","commonSituations":"Upgrading from a very old Cassandra release without running upgradesstables first; restoring backups written by an older major version; point tools at mixed-version data directories.","solutions":["Run nodetool upgradesstables (or sstableupgrade) on the data before moving/opening","Load old SSTables through sstableloader, which rewrites them to the current version","If the file truly is incompatible/unreadable, remove it and rebuild data via nodetool repair from other replicas","Verify the intended version with sstablemetadata and confirm the Cassandra version matches the data files"],"exampleFix":"// before: moving and opening old-version sstable directly\nSSTableReader.moveAndOpenSSTable(cfs, oldDesc, newDesc, comps, false);\n// after: upgrade first\n// run: nodetool upgradesstables --ks ks --cf tbl\nSSTableReader.moveAndOpenSSTable(cfs, oldDesc, newDesc, comps, false);","handlingStrategy":"validation","validationCode":"// check descriptor compatibility before moving\nDescriptor d = Descriptor.fromFilename(file);\nif (!d.isCompatible()) { upgradeFirst(); } // e.g. run sstableupgrade","typeGuard":null,"tryCatchPattern":"try { SSTableReader.moveAndOpenSSTable(cfs, oldDesc, newDesc, comps, false); }\ncatch (RuntimeException e) {\n    if (e.getMessage().startsWith(\"Can't open incompatible SSTable\")) {\n        logger.error(\"SSTable version incompatible: {}\", oldDesc, e);\n        runUpgradesstables();\n    } else throw e;\n}","preventionTips":["Always run nodetool upgradesstables after major-version upgrades before tooling","Check sstable version with sstablemetadata before offline operations","Keep backup/restore tooling version-matched to the cluster","Follow the documented upgrade path between Cassandra versions"],"tags":["sstable","version-compatibility","upgrade"],"backgroundTag":"incompatible-source-type","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"}