{"record":{"id":"3d00f4a6870bd132","repo":"apache/cassandra","slug":"corruptsstableexception-nosuchfileexception-mis","errorCode":null,"errorMessage":"CorruptSSTableException / NoSuchFileException: missing compression info component file ${compressionInfoFile.absolutePath()}","messagePattern":"CorruptSSTableException / NoSuchFileException: missing compression info component file (.+?)","errorType":"exception","errorClass":"CorruptSSTableException","httpStatus":null,"severity":"critical","filePath":"src/java/org/apache/cassandra/io/sstable/format/CompressionInfoComponent.java","lineNumber":85,"sourceCode":"     * The verification depends on the existence of TOC file. If absent, the verification is skipped.\n     *\n     * @param descriptor\n     * @param actualComponents actual components listed from the file system.\n     * @throws CorruptSSTableException if TOC expects compression info but not found from disk.\n     * @throws FSReadError             if unable to read from TOC file.\n     */\n    public static void verifyCompressionInfoExistenceIfApplicable(Descriptor descriptor, Set<Component> actualComponents) throws CorruptSSTableException, FSReadError\n    {\n        File tocFile = descriptor.fileFor(Components.TOC);\n        if (tocFile.exists())\n        {\n            try\n            {\n                Set<Component> expectedComponents = TOCComponent.loadTOC(descriptor, false);\n                if (expectedComponents.contains(Components.COMPRESSION_INFO) && !actualComponents.contains(Components.COMPRESSION_INFO))\n                {\n                    File compressionInfoFile = descriptor.fileFor(Components.COMPRESSION_INFO);\n                    throw new CorruptSSTableException(new NoSuchFileException(compressionInfoFile.absolutePath()), compressionInfoFile);\n                }\n            }\n            catch (IOException e)\n            {\n                throw new FSReadError(e, tocFile);\n            }\n        }\n    }\n}\n","sourceCodeStart":67,"sourceCodeEnd":95,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/io/sstable/format/CompressionInfoComponent.java#L67-L95","documentation":"verifyCompressionInfoExistenceIfApplicable validates that an SSTable whose TOC lists a CompressionInfo component actually has the CompressionInfo.db file on disk. When the TOC expects it but the file is absent, it throws CorruptSSTableException wrapping NoSuchFileException naming the missing file path. This catches SSTables whose component set is incomplete.","triggerScenarios":"Opening/loading a compressed SSTable where the CompressionInfo component is listed in the TOC but CompressionInfo.db does not exist in the SSTable directory (file deleted, incomplete copy/restore, snapshot moved without all components).","commonSituations":"Manual SSTable restores that copied only some components; backups taken mid-write; cleanup scripts deleting 'extra' files; moved SSTables between nodes without the TOC-listed components.","solutions":["Restore the missing CompressionInfo.db from a snapshot/backup of the same SSTable, or copy the complete SSTable (all TOC components) again","If the data is recoverable from other replicas, move/delete the incomplete SSTable and run nodetool repair to restore the range","Use the TOC (Index.db/_toc file) to enumerate required components and verify the whole set exists before re-adding the SSTable","Rebuild the SSTable from source (re-stream/rewriter) if no backup exists"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Verify all TOC-listed components exist before adding an SSTable\nSet<Component> toc = TOCComponent.loadTOC(descriptor, false);\nfor (Component c : toc)\n    if (!descriptor.fileFor(c).exists())\n        throw new IllegalStateException(\"Missing component \" + c + \" for \" + descriptor);","typeGuard":null,"tryCatchPattern":"try { sstable = openSSTable(descriptor); }\ncatch (CorruptSSTableException e) {\n    logger.error(\"Incomplete SSTable {}: {}\", descriptor, e.getMessage());\n    // restore from snapshot or remove and repair\n}","preventionTips":["Never copy SSTables file-by-file; use nodetool snapshot and copy the whole snapshot dir","Include _toc and all TOC-listed components in any backup","Check TOC completeness before moving SSTables between nodes","Avoid cleanup scripts that delete 'unknown' files in data dirs"],"tags":["sstable","missing-file","corruption","compression"],"backgroundTag":"file-not-found","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"}