apache/cassandra · error · RuntimeException

Error occurred during flushing

Error message

Error occurred during flushing

What it means

Nodetool's Flush command wraps any exception from the JMX call forceKeyspaceFlush in a RuntimeException with this message. It means the flush of one or more keyspaces/tables failed on the server side, or the JMX operation itself failed. The original cause is attached as the suppressed exception.

Solutions

  1. Read the 'Caused by' exception in nodetool output for the real server-side cause
  2. Verify keyspace and table names with `nodetool describecluster` / cqlsh DESCRIBE keyspaces
  3. Check the node logs and disk health (df -h, dmesg) for I/O errors
  4. Retry after resolving the underlying storage issue

Example fix

// before (script ignores real cause)
nodetool flush myks my_table || echo failed
// after
nodetool flush myks my_table 2>&1 | tee /tmp/flush.log; grep 'Caused by' /tmp/flush.log
Defensive patterns

Strategy: try-catch

Validate before calling

// verify names before flushing
cqlsh -e "DESCRIBE KEYSPACES" | grep -qw myks || { echo 'keyspace missing'; exit 1; }

Try / catch

try { nodetool.flush(ks, tables); } catch (RuntimeException e) { log.error("flush failed", e.getCause()); }

Prevention

When it happens

Trigger: Running `nodetool flush [keyspace [tables...]]` when a keyspace/table name does not exist, the node is unable to flush memtables (disk I/O error, corrupt memtable), or the JMX connection drops mid-operation.

Common situations: Flushing before an upgrade or snapshot when a table name is misspelled; disk full or failing on the node; flushing a keyspace that only exists on other nodes.

Related errors


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

Appendix: source

Thrown at src/java/org/apache/cassandra/tools/nodetool/Flush.java:60

    @Parameters(index = "1..*", description = "The tables to flush", arity = "0..*")
    private String[] tables;

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

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

        for (String keyspace : keyspaces)
        {
            try
            {
                probe.forceKeyspaceFlush(keyspace, tableNames);
            } catch (Exception e)
            {
                throw new RuntimeException("Error occurred during flushing", e);
            }
        }
    }
}

View on GitHub (pinned to 88fd0f6a0e)