{"record":{"id":"e41efa65df960177","repo":"apache/cassandra","slug":"error-occurred-during-status-auto-compaction","errorCode":null,"errorMessage":"Error occurred during status-auto-compaction","messagePattern":"Error occurred during status-auto-compaction","errorType":"exception","errorClass":"java.lang.RuntimeException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/nodetool/StatusAutoCompaction.java","lineNumber":85,"sourceCode":"                Map<String, Boolean> statuses = probe.getAutoCompactionDisabled(keyspace, tableNames);\n                for (Map.Entry<String, Boolean> status : statuses.entrySet())\n                {\n                    String tableName = status.getKey();\n                    boolean disabled = status.getValue();\n                    allDisabled &= disabled;\n                    allEnabled &= !disabled;\n                    table.add(keyspace, tableName, !disabled ? \"running\" : \"not running\");\n                }\n            }\n            if (showAll)\n                table.printTo(probe.output().out);\n            else\n                probe.output().out.println(allEnabled ? \"running\" :\n                                   allDisabled ? \"not running\" : \"partially running\");\n        }\n        catch (IOException e)\n        {\n            throw new RuntimeException(\"Error occurred during status-auto-compaction\", e);\n        }\n    }\n}\n","sourceCodeStart":67,"sourceCodeEnd":89,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/nodetool/StatusAutoCompaction.java#L67-L89","documentation":"nodetool statusautocompaction wraps any IOException from querying the node's auto-compaction status via NodeProbe/JMX into a RuntimeException with the message 'Error occurred during status-auto-compaction'. The real failure is in the cause (connection, MBean, or server-side error).","triggerScenarios":"JMX connection failure, the StorageService MBean being unavailable, or a server-side IOException while listing compaction status for the requested keyspaces/tables.","commonSituations":"Running against a node with JMX not started or firewalled, wrong JMX credentials/port, or a node in a degraded state during rolling upgrades.","solutions":["Check the underlying cause in the stack trace and the node's system.log.","Verify JMX connectivity: `nodetool status` works, correct -h/-p/JMX port and credentials.","Confirm the keyspace/table arguments exist; retry once the node is healthy."],"exampleFix":"// before\nnodetool statusautocompaction  # generic RuntimeException\n// after\nnodetool statusautocompaction 2>&1 | grep -B2 -A10 'Caused by'   # inspect root cause first","handlingStrategy":"try-catch","validationCode":"// Pre-check: ensure JMX reachable, e.g. run `nodetool status` and check exit code before statusautocompaction","typeGuard":null,"tryCatchPattern":"try { probe.statusAutoCompaction(ks); } catch (RuntimeException e) { if (e.getMessage().startsWith(\"Error occurred during status-auto-compaction\")) { inspectCause(e.getCause()); verifyJmx(); } else throw e; }","preventionTips":["Validate JMX port/credentials in monitoring scripts","Run statusautocompaction only on healthy nodes","Check node logs when the wrapped exception appears"],"tags":["nodetool","compaction","jmx"],"backgroundTag":"jmx-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"}