{"record":{"id":"92bf424f04b71154","repo":"apache/cassandra","slug":"failed-verifying-sstable-descriptor","errorCode":null,"errorMessage":"Failed verifying SSTable <descriptor>","messagePattern":"Failed verifying SSTable <descriptor>","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/db/SSTableImporter.java","lineNumber":149,"sourceCode":"                                                                                          table));\n                                    }\n                                }\n                            }\n\n                            if (options.verifySSTables || options.verifyTokens)\n                                verifySSTableForImport(descriptor, entry.getValue(), options.verifyTokens, options.verifySSTables, options.extendedVerify);\n                        }\n                        catch (Throwable t)\n                        {\n                            if (dir != null)\n                            {\n                                logger.error(\"[{}] Failed verifying SSTable {} in directory {}\", importID, descriptor, dir, t);\n                                failedDirectories.add(dir);\n                            }\n                            else\n                            {\n                                logger.error(\"[{}] Failed verifying SSTable {}\", importID, descriptor, t);\n                                throw new RuntimeException(\"Failed verifying SSTable \" + descriptor, t);\n                            }\n                            break;\n                        }\n                    }\n                }\n            }\n        }\n\n        Set<SSTableReader> newSSTables = new HashSet<>();\n        for (Pair<Directories.SSTableLister, String> listerPair : listers)\n        {\n            Directories.SSTableLister lister = listerPair.left;\n            String dir = listerPair.right;\n            if (failedDirectories.contains(dir))\n                continue;\n\n            Set<MovedSSTable> movedSSTables = new HashSet<>();\n            Set<SSTableReader> newSSTablesPerDirectory = new HashSet<>();","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/SSTableImporter.java#L131-L167","documentation":"SSTableImporter wraps any Throwable raised while verifying an SSTable descriptor (reading metadata/components in the import directory) in a RuntimeException 'Failed verifying SSTable <descriptor>' and aborts the import. It signals the SSTable could not be validated, e.g., corrupt, unreadable, or incompatible files.","triggerScenarios":"importNewSSTables calls SSTableReader validation on a descriptor in the import directory and it throws (corrupt data file, missing required components, unreadable directory, wrong schema/version), and the directory is not one of the designated failedDirectories being handled.","commonSituations":"Copying SSTables mid-compaction leaving inconsistent components; truncated data files from an interrupted scp/rsync; importing SSTables from an incompatible Cassandra version; wrong file permissions on the import directory.","solutions":["Re-copy the SSTable set completely and verify checksums (e.g., rsync with --checksum) before importing","Confirm the source SSTables come from the same Cassandra major version and matching schema","Check filesystem permissions and disk health on the import directory; fix and retry","If a specific directory is bad, remove the offending SSTable from the import directory (or mark the directory as failed) and import the rest"],"exampleFix":"// before: partially copied SSTable\nrsync -a src/ /data/import/   # interrupted, truncated files\n// after: complete, verified copy\nrsync -a --checksum --delete src/ /data/import/ && nodetool import -- ks table /data/import","handlingStrategy":"validation","validationCode":"// verify components exist and checksums match before import\nfor (String f : requiredComponents(descriptor)) {\n    File file = new File(importDir, f);\n    if (!file.canRead()) throw new IOException(\"missing/unreadable component: \" + f);\n    verifyChecksum(file, checksums.get(f));\n}","typeGuard":null,"tryCatchPattern":"try {\n    nodetool(\"import\", \"--\", ks, table, dir);\n} catch (RuntimeException e) {\n    if (e.getMessage().startsWith(\"Failed verifying SSTable\")) {\n        // re-copy the offending SSTable from a healthy source, then retry\n        reCopySstable(dir);\n        nodetool(\"import\", \"--\", ks, table, dir);\n    }\n}","preventionTips":["Use rsync --checksum or verified copy tools when staging SSTables","Never copy from a source mid-compaction; use nodetool snapshot","Keep source and destination Cassandra versions/schema compatible","Check disk health (dmesg/SMART) when verification repeatedly fails"],"tags":["sstable","import","corruption","verification"],"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-14T16:17:12.679Z"}