{"record":{"id":"24259a6fd00698cb","repo":"apache/cassandra","slug":"unsupported-sstable-version","errorCode":null,"errorMessage":"Unsupported SSTable version /","messagePattern":"Unsupported SSTable version /","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/Util.java","lineNumber":315,"sourceCode":"    }\n\n    public static <T> Stream<T> iterToStream(Iterator<T> iter)\n    {\n        Spliterator<T> splititer = Spliterators.spliteratorUnknownSize(iter, Spliterator.IMMUTABLE);\n        return StreamSupport.stream(splititer, false);\n    }\n\n    /**\n     * Construct table schema from info stored in SSTable's Stats.db\n     *\n     * @param desc SSTable's descriptor\n     * @return Restored CFMetaData\n     * @throws IOException when Stats.db cannot be read\n     */\n    public static TableMetadata metadataFromSSTable(Descriptor desc) throws IOException\n    {\n        if (!desc.version.isCompatible())\n            throw new IOException(\"Unsupported SSTable version \" + desc.getFormat().name() + \"/\" + desc.version);\n\n        StatsComponent statsComponent = StatsComponent.load(desc, MetadataType.STATS, MetadataType.HEADER);\n        SerializationHeader.Component header = statsComponent.serializationHeader();\n\n        IPartitioner partitioner = FBUtilities.newPartitioner(desc);\n\n        TableMetadata.Builder builder = TableMetadata.builder(\"keyspace\", \"table\").partitioner(partitioner).offline();\n        header.getStaticColumns().entrySet().stream()\n                .forEach(entry -> {\n                    ColumnIdentifier ident = ColumnIdentifier.getInterned(UTF8Type.instance.getString(entry.getKey()), true);\n                    builder.addStaticColumn(ident, entry.getValue());\n                });\n        header.getRegularColumns().entrySet().stream()\n                .forEach(entry -> {\n                    ColumnIdentifier ident = ColumnIdentifier.getInterned(UTF8Type.instance.getString(entry.getKey()), true);\n                    builder.addRegularColumn(ident, entry.getValue());\n                });\n        builder.addPartitionKeyColumn(\"PartitionKey\", header.getKeyType());","sourceCodeStart":297,"sourceCodeEnd":333,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/Util.java#L297-L333","documentation":"Util.metadataFromSSTable reconstructs TableMetadata by reading the Stats.db component of an SSTable Descriptor, and throws IOException when the descriptor's SSTable version is not compatible with the running code. It reports the format name and version so you can see which legacy/unknown sstable was passed.","triggerScenarios":"Pointing offline tools (sstablemetadata, sstabledump, metadataFromSSTable) at an sstable written by a version too old (e.g. 'ma'/'mc' after support was dropped) or by a newer Cassandra than the tool being run.","commonSituations":"Upgrading Cassandra but running the old tools against new sstables; restoring a backup from an ancient version; copying sstables from a newer cluster into an older one.","solutions":["Run the tool from a Cassandra version whose sstable version is compatible with the file (upgrade the tool, not the file)","Use the matching major version: check desc.getFormat().name() in the message to identify which release wrote it","If the file is legacy, upgrade the sstables with upgradesstables on an intermediate Cassandra release before reading","Verify you did not mix sstables from different Cassandra versions in the same directory"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (!desc.version.isCompatible())\n    throw new IOException(\"Refusing to read sstable \" + desc + \": unsupported version \" + desc.version);","typeGuard":null,"tryCatchPattern":"try {\n    TableMetadata md = Util.metadataFromSSTable(desc);\n} catch (IOException e) {\n    if (e.getMessage().startsWith(\"Unsupported SSTable version\")) {\n        // switch to a compatible tool/Cassandra version\n    } else {\n        throw e;\n    }\n}","preventionTips":["Match tool version to the Cassandra version that wrote the sstable","Check Descriptor.version before processing files","Don't mix sstables from different Cassandra versions"],"tags":["sstable","versioning","offline-tools","io"],"backgroundTag":"unsupported-version","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"}