{"record":{"id":"d19a5fca37dc97b6","repo":"apache/cassandra","slug":"corruptsstableexception-wrapped-ioexception-from","errorCode":null,"errorMessage":"CorruptSSTableException (wrapped IOException from IOError, with sstable filename)","messagePattern":"CorruptSSTableException \\(wrapped IOException from IOError, with sstable filename\\)","errorType":"exception","errorClass":"CorruptSSTableException","httpStatus":null,"severity":"critical","filePath":"src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java","lineNumber":240,"sourceCode":"\n            return doCompute();\n        }\n        catch (IndexOutOfBoundsException | VIntOutOfRangeException | AssertionError e)\n        {\n            sstable.markSuspect();\n            throw new CorruptSSTableException(e, filename);\n        }\n        catch (CorruptSSTableException e) // to ensure that we marked the sstable as suspected if CorruptSSTableException is thrown from lower levels\n        {\n            sstable.markSuspect();\n            throw e;\n        }\n        catch (IOError e)\n        {\n            if (e.getCause() instanceof IOException)\n            {\n                sstable.markSuspect();\n                throw new CorruptSSTableException((Exception)e.getCause(), filename);\n            }\n            else\n            {\n                throw e;\n            }\n        }\n    }\n\n    protected Unfiltered doCompute()\n    {\n        Unfiltered unfiltered = iterator.next();\n        UnfilteredValidation.maybeValidateUnfiltered(unfiltered, metadata(), key, sstable);\n        return unfiltered;\n    }\n\n    public void close()\n    {\n        // creator is responsible for closing file when finished","sourceCodeStart":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java#L222-L258","documentation":"In SSTableIdentityIterator.next(), an IOError caused by an IOException during row computation is converted to CorruptSSTableException (with the sstable filename) after marking the sstable suspect; IErrors with non-IOException causes are rethrown as-is. This surfaces storage read failures during row reads as corruption errors.","triggerScenarios":"Calling next() when the wrapped file reader throws IOError whose cause is an IOException — e.g. underlying channel read failure, file truncated under the reader, or decompression IOException raised inside the row computation.","commonSituations":"Host disk or storage-backend I/O errors during reads; sstable removed/truncated by an external process; failing network-attached storage; corrupted compression chunks.","solutions":["Scrub the affected table (`nodetool scrub`) to deal with the corrupt sstable named in the error","Repair (`nodetool repair`) or restore the sstable from a good backup to recover the data","Inspect system logs for I/O errors and remediate failing storage","Prevent external modification/deletion of sstable files by non-Cassandra processes"],"exampleFix":"// before: node repeatedly failing on the same sstable\n// after: scrub + repair\nnodetool scrub -- keyspace table\nnodetool repair -- keyspace table","handlingStrategy":"try-catch","validationCode":"// pre-flight: confirm file readable end-to-end\n// nodetool verify reads full sstables and reports I/O problems before serving traffic\nverifySstableReadable(filename);","typeGuard":null,"tryCatchPattern":"try {\n    Row row = iter.next();\n} catch (CorruptSSTableException e) {\n    logger.error(\"I/O failure reading sstable {}\", e.getPath(), e.getCause());\n    // fall back to another replica; schedule repair\n} catch (IOError e) {\n    throw e; // non-IO failures propagate\n}","preventionTips":["Use dependable local storage; avoid flaky NFS for data directories","Monitor dmesg for I/O errors and act on them","Keep backups so damaged sstables can be restored","Avoid external deletion/truncation of sstable files","Repair regularly to keep healthy replicas"],"tags":["sstable","corruption","io","storage"],"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"}