{"record":{"id":"7739b9acb25b074e","repo":"apache/cassandra","slug":"s-is-not-the-latest-version-run-upgradesstables","errorCode":null,"errorMessage":"%s is not the latest version, run upgradesstables","messagePattern":"(.+?) is not the latest version, run upgradesstables","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/io/sstable/format/SortedTableVerifier.java","lineNumber":214,"sourceCode":"                !statsComponent.validationMetadata().partitioner.equals(sstable.getPartitioner().getClass().getCanonicalName()))\n                throw new IOException(\"Partitioner does not match validation metadata\");\n        }\n        catch (Throwable t)\n        {\n            outputHandler.warn(t);\n            markAndThrow(t, false);\n        }\n    }\n\n    protected void verifySSTableVersion()\n    {\n        outputHandler.output(\"Verifying %s (%s)\", sstable, FBUtilities.prettyPrintMemory(dataFile.length()));\n        if (options.checkVersion && !sstable.descriptor.version.isLatestVersion())\n        {\n            String msg = String.format(\"%s is not the latest version, run upgradesstables\", sstable);\n            outputHandler.output(msg);\n            // don't use markAndThrow here because we don't want a CorruptSSTableException for this.\n            throw new RuntimeException(msg);\n        }\n    }\n\n    protected int verifyOwnedRanges()\n    {\n        List<Range<Token>> ownedRanges = Collections.emptyList();\n        if (outputHandler.isDebugEnabled()) outputHandler.debug(\"Checking that all tokens are owned by the current node\");\n        try (KeyIterator iter = sstable.keyIterator())\n        {\n            ownedRanges = Range.normalize(tokenLookup.apply(cfs.metadata.keyspace));\n            if (ownedRanges.isEmpty())\n                return 0;\n            RangeOwnHelper rangeOwnHelper = new RangeOwnHelper(ownedRanges);\n            while (iter.hasNext())\n            {\n                DecoratedKey key = iter.next();\n                rangeOwnHelper.validate(key);\n            }","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/io/sstable/format/SortedTableVerifier.java#L196-L232","documentation":"`nodetool verify` with the checkVersion option rejects SSTables whose on-disk format version is not the latest for the running Cassandra version. It throws a plain RuntimeException (deliberately not CorruptSSTableException) because the file is not corrupt, just outdated; the fix is running upgradesstables to rewrite it in the current format.","triggerScenarios":"Running `nodetool verify --check-version` (or equivalent options.invokedBy verification) against SSTables written by an older Cassandra version (e.g. pre-upgrade files, files restored from old snapshots) that haven't been upgraded.","commonSituations":"After a rolling Cassandra upgrade before `nodetool upgradesstables` completed; restoring old snapshots/backup files; nodes that rejoined with legacy SSTables.","solutions":["Run `nodetool upgradesstables` to rewrite SSTables to the current version.","If upgradesstables skips them, run `nodetool upgradesstables --include-all-sstables`.","Alternatively run `nodetool scrub` or a full compaction to rewrite the files.","Drop --check-version from verify if the old format is still acceptable (it will be upgraded by normal compaction)."],"exampleFix":"// before: verify fails on old-format sstable\nnodetool verify --check-version keyspace1 standard1\n// after: upgrade format first, then verify\nnodetool upgradesstables keyspace1 standard1\nnodetool verify --check-version keyspace1 standard1","handlingStrategy":"validation","validationCode":"// Java: check sstable version before verifying with checkVersion\nboolean latest = sstable.descriptor.version.isLatestVersion();\nif (!latest) System.out.println(\"Run upgradesstables for \" + sstable.getFilename());","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `nodetool upgradesstables` as a standard post-upgrade step","Automate upgradesstables after every version upgrade before running verify","Track sstable versions via `nodetool sstableinfo` or sstablemetadata"],"tags":["sstable","version","upgrade","verification"],"backgroundTag":"deprecated-api-usage","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"}