{"record":{"id":"2e9002cb492eb44f","repo":"apache/cassandra","slug":"error-occurred-during-scrubbing","errorCode":null,"errorMessage":"Error occurred during scrubbing","messagePattern":"Error occurred during scrubbing","errorType":"exception","errorClass":"java.lang.RuntimeException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/nodetool/Scrub.java","lineNumber":89,"sourceCode":"    public void execute(NodeProbe probe)\n    {\n        args = concatArgs(keyspace, tables);\n        List<String> keyspaces = CommandUtils.parseOptionalKeyspace(args, probe);\n        String[] tableNames = CommandUtils.parseOptionalTables(args);\n\n        for (String keyspace : keyspaces)\n        {\n            try\n            {\n                probe.scrub(probe.output().out, disableSnapshot, skipCorrupted, !noValidation, reinsertOverflowedTTL, jobs, keyspace, tableNames);\n            }\n            catch (IllegalArgumentException e)\n            {\n                throw e;\n            }\n            catch (Exception e)\n            {\n                throw new RuntimeException(\"Error occurred during scrubbing\", e);\n            }\n        }\n    }\n}\n","sourceCodeStart":71,"sourceCodeEnd":94,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/nodetool/Scrub.java#L71-L94","documentation":"Nodetool Scrub re-throws IllegalArgumentException unchanged (bad user arguments) but wraps every other exception from the scrub operation in a RuntimeException 'Error occurred during scrubbing'. The scrub may have already begun on the node, so check how far it progressed before retrying.","triggerScenarios":"`nodetool scrub` when the node-side scrub fails mid-operation: corrupt SSTables that cannot be read/moved, IO errors, invalid combination of scrub options rejected remotely (non-IAE).","commonSituations":"Scrubbing genuinely corrupted SSTables after a crash; disk-space exhaustion during scrub (scrub writes new SSTables); running scrub concurrently with other compactions.","solutions":["Check node logs and the wrapped cause for the failing SSTable","Free disk space — scrub needs room to rewrite SSTables","Re-run scrub with --no-skip or recover segments; use `nodetool verifysstable`/sstablemetadata to isolate corrupt files","Restore corrupt SSTables from backup if scrub cannot fix them"],"exampleFix":"// before\nnodetool scrub myks (with <5% free disk)\n// after\ndf -h  # ensure ample free space, then\nnodetool scrub myks","handlingStrategy":"validation","validationCode":"df -h \"$DATA_DIR\" | awk 'NR==2 && $5+0 > 90 {print \"insufficient disk for scrub\"; exit 1}'","typeGuard":null,"tryCatchPattern":"try { probe.scrub(out, options, ks, tables); } catch (IllegalArgumentException e) { throw e; /* bad args: fix invocation */ } catch (RuntimeException e) { log.error(\"scrub failed: {}\", e.getCause(), e); /* inspect corrupt sstables before retry */ throw e; }","preventionTips":["Keep ample free disk for rewritten SSTables","Avoid running scrub concurrently with compactions","Quarantine corrupt SSTables identified in logs"],"tags":["nodetool","scrub","sstables","data-corruption"],"backgroundTag":"api-request-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"}