{"record":{"id":"4448510f9c58b5f2","repo":"apache/cassandra","slug":"error-occurred-during-flushing-444851","errorCode":null,"errorMessage":"Error occurred during flushing","messagePattern":"Error occurred during flushing","errorType":"console","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/nodetool/Flush.java","lineNumber":60,"sourceCode":"    @Parameters(index = \"1..*\", description = \"The tables to flush\", arity = \"0..*\")\n    private String[] tables;\n\n    @Override\n    public void execute(NodeProbe probe)\n    {\n        args = concatArgs(keyspace, tables);\n\n        List<String> keyspaces = parseOptionalKeyspace(args, probe);\n        String[] tableNames = parseOptionalTables(args);\n\n        for (String keyspace : keyspaces)\n        {\n            try\n            {\n                probe.forceKeyspaceFlush(keyspace, tableNames);\n            } catch (Exception e)\n            {\n                throw new RuntimeException(\"Error occurred during flushing\", e);\n            }\n        }\n    }\n}\n","sourceCodeStart":42,"sourceCodeEnd":65,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/nodetool/Flush.java#L42-L65","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Read the 'Caused by' exception in nodetool output for the real server-side cause","Verify keyspace and table names with `nodetool describecluster` / cqlsh DESCRIBE keyspaces","Check the node logs and disk health (df -h, dmesg) for I/O errors","Retry after resolving the underlying storage issue"],"exampleFix":"// before (script ignores real cause)\nnodetool flush myks my_table || echo failed\n// after\nnodetool flush myks my_table 2>&1 | tee /tmp/flush.log; grep 'Caused by' /tmp/flush.log","handlingStrategy":"try-catch","validationCode":"// verify names before flushing\ncqlsh -e \"DESCRIBE KEYSPACES\" | grep -qw myks || { echo 'keyspace missing'; exit 1; }","typeGuard":null,"tryCatchPattern":"try { nodetool.flush(ks, tables); } catch (RuntimeException e) { log.error(\"flush failed\", e.getCause()); }","preventionTips":["Always log e.getCause() — the message here only wraps the real error","Validate keyspace/table names before scripting nodetool calls","Monitor disk usage before flush-heavy maintenance"],"tags":["nodetool","jmx","flush"],"backgroundTag":"api-error-response","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"}