{"record":{"id":"8f7d44daea95d5f0","repo":"apache/cassandra","slug":"error-occurred-during-cleanup","errorCode":null,"errorMessage":"Error occurred during cleanup","messagePattern":"Error occurred during cleanup","errorType":"console","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/nodetool/Cleanup.java","lineNumber":71,"sourceCode":"    public void execute(NodeProbe probe)\n    {\n        args = concatArgs(keyspace, tables);\n\n        List<String> keyspaces = parseOptionalKeyspaceNonLocal(args, probe);\n        String[] tableNames = parseOptionalTables(args);\n\n        for (String keyspace : keyspaces)\n        {\n            if (SchemaConstants.isLocalSystemKeyspace(keyspace))\n                continue;\n\n            try\n            {\n                probe.forceKeyspaceCleanup(probe.output().out, jobs, keyspace, tableNames);\n            }\n            catch (Exception e)\n            {\n                throw new RuntimeException(\"Error occurred during cleanup\", e);\n            }\n        }\n    }\n}\n","sourceCodeStart":53,"sourceCodeEnd":76,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/nodetool/Cleanup.java#L53-L76","documentation":"`nodetool cleanup` wraps any exception from forceKeyspaceCleanup into a RuntimeException with the fixed message 'Error occurred during cleanup', preserving the original cause. It signals that the cleanup compaction task failed on the node.","triggerScenarios":"Any failure inside StorageService.forceKeyspaceCleanup: keyspace/table does not exist, concurrent operation rejected (node busy, validation running), or an internal IO error during compaction.","commonSituations":"Typo in keyspace or table name, running cleanup on a node undergoing repair/compaction contention, or disk/IO failures during the resulting compactions.","solutions":["Read the 'Caused by' stack trace to find the root cause","Verify keyspace and table names with `nodetool cleanup <keyspace> <table>` spelling (cqlsh DESCRIBE KEYSPACES)","Re-run cleanup after any concurrent repair/streaming operation finishes"],"exampleFix":"// before\nnodetool cleanup nonexist_ks\n// after\nnodetool cleanup my_keyspace my_table","handlingStrategy":"try-catch","validationCode":"// verify keyspace/table exist before cleanup\n// cqlsh: DESCRIBE KEYSPACES; DESCRIBE TABLES;","typeGuard":null,"tryCatchPattern":"try { probe.forceKeyspaceCleanup(out, jobs, ks, tables); }\ncatch (RuntimeException e) {\n    logger.error(\"cleanup failed: {}\", e.getCause(), e);\n}","preventionTips":["Check the Caused by chain for the root reason","Avoid running cleanup concurrently with repairs","Validate keyspace/table names first"],"tags":["nodetool","compaction","cleanup"],"backgroundTag":"database-operation-failed","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"}