{"record":{"id":"6f0191bfa1c94b35","repo":"apache/cassandra","slug":"missing-component-s","errorCode":null,"errorMessage":"Missing component: %s","messagePattern":"Missing component: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/io/sstable/format/big/BigTableScrubber.java","lineNumber":68,"sourceCode":"    private ByteBuffer nextIndexKey;\n    private long currentPartitionPositionFromIndex;\n    private long nextPartitionPositionFromIndex;\n\n    public BigTableScrubber(ColumnFamilyStore cfs,\n                            LifecycleTransaction transaction,\n                            OutputHandler outputHandler,\n                            Options options)\n    {\n        super(cfs, transaction, outputHandler, options);\n\n        this.rowIndexEntrySerializer = new RowIndexEntry.Serializer(sstable.descriptor.version, sstable.header, cfs.getMetrics());\n\n        boolean hasIndexFile = sstable.descriptor.fileFor(Components.PRIMARY_INDEX).exists();\n        this.isIndex = cfs.isIndex();\n        if (!hasIndexFile)\n        {\n            // if there's any corruption in the -Data.db then partitions can't be skipped over. but it's worth a shot.\n            outputHandler.warn(\"Missing component: %s\", sstable.descriptor.fileFor(Components.PRIMARY_INDEX));\n        }\n\n        this.indexFile = hasIndexFile\n                         ? RandomAccessReader.open(sstable.descriptor.fileFor(Components.PRIMARY_INDEX))\n                         : null;\n\n        this.currentPartitionPositionFromIndex = 0;\n        this.nextPartitionPositionFromIndex = 0;\n    }\n\n    @Override\n    protected UnfilteredRowIterator withValidation(UnfilteredRowIterator iter, String filename)\n    {\n        return options.checkData && !isIndex ? UnfilteredRowIterators.withValidation(iter, filename) : iter;\n    }\n\n    @Override\n    protected void scrubInternal(SSTableRewriter writer) throws IOException","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/io/sstable/format/big/BigTableScrubber.java#L50-L86","documentation":"During scrub of a big-format SSTable, the scrubber checks for the PRIMARY_INDEX (-Index.db) component. If it does not exist on disk it emits this warning and proceeds to scrub without the index, meaning partition sizes/positions cannot be cross-validated and corrupt partitions cannot be skipped over reliably.","triggerScenarios":"Running `nodetool scrub` (BigTableScrubber constructor) on an SSTable whose descriptor.fileFor(Components.PRIMARY_INDEX) does not exist — the -Index.db file was deleted, lost, or the table was moved/restored incompletely.","commonSituations":"Incomplete backup restores, manual sstable copying that omitted sidecar components, disk cleanup scripts deleting 'extra' files, or a crash during compaction leaving partial sstables.","solutions":["Restore the missing -Index.db file from a backup or re-stream the sstable from a replica","Run scrub accepting no index-based skipping if the data file is trusted","Run `nodetool repair` so healthy replicas replace the degraded sstable","If the data file is also suspect, rebuild the data from client-side sources or snapshots"],"exampleFix":"// before: sstable missing -Index.db\nboolean hasIndexFile = sstable.descriptor.fileFor(Components.PRIMARY_INDEX).exists();\n// after: pre-check components before scrubbing\nif (!sstable.descriptor.fileFor(Components.PRIMARY_INDEX).exists())\n    logger.warn(\"{} missing primary index; restore from snapshot/replica before scrub\", sstable);","handlingStrategy":"validation","validationCode":"File idx = sstable.descriptor.fileFor(Components.PRIMARY_INDEX);\nif (!idx.exists())\n    throw new IllegalStateException(\"SSTable is missing \" + idx + \"; restore before scrub\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use Cassandra snapshot/restore tooling rather than manual file copies so all components travel together","Run `nodetool verify` before scrubbing to detect missing components","Never delete sstable sidecar files manually","Restore sstables as complete directory sets"],"tags":["cassandra","sstable","scrub","missing-file"],"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-17T15:17:12.973Z"}