apache/cassandra · error · RuntimeException

Error occurred during cleanup

Error message

Error occurred during cleanup

What it means

`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.

Solutions

  1. Read the 'Caused by' stack trace to find the root cause
  2. Verify keyspace and table names with `nodetool cleanup <keyspace> <table>` spelling (cqlsh DESCRIBE KEYSPACES)
  3. Re-run cleanup after any concurrent repair/streaming operation finishes

Example fix

// before
nodetool cleanup nonexist_ks
// after
nodetool cleanup my_keyspace my_table
Defensive patterns

Strategy: try-catch

Validate before calling

// verify keyspace/table exist before cleanup
// cqlsh: DESCRIBE KEYSPACES; DESCRIBE TABLES;

Try / catch

try { probe.forceKeyspaceCleanup(out, jobs, ks, tables); }
catch (RuntimeException e) {
    logger.error("cleanup failed: {}", e.getCause(), e);
}

Prevention

When it happens

Trigger: Any failure inside StorageService.forceKeyspaceCleanup: keyspace/table does not exist, concurrent operation rejected (node busy, validation running), or an internal IO error during compaction.

Common situations: Typo in keyspace or table name, running cleanup on a node undergoing repair/compaction contention, or disk/IO failures during the resulting compactions.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/8f7d44daea95d5f0. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/tools/nodetool/Cleanup.java:71

    public void execute(NodeProbe probe)
    {
        args = concatArgs(keyspace, tables);

        List<String> keyspaces = parseOptionalKeyspaceNonLocal(args, probe);
        String[] tableNames = parseOptionalTables(args);

        for (String keyspace : keyspaces)
        {
            if (SchemaConstants.isLocalSystemKeyspace(keyspace))
                continue;

            try
            {
                probe.forceKeyspaceCleanup(probe.output().out, jobs, keyspace, tableNames);
            }
            catch (Exception e)
            {
                throw new RuntimeException("Error occurred during cleanup", e);
            }
        }
    }
}

View on GitHub (pinned to 88fd0f6a0e)