{"record":{"id":"f3cdc8b05b5b6002","repo":"apache/cassandra","slug":"could-not-retrieve-list-of-stat-mbeans","errorCode":null,"errorMessage":"Could not retrieve list of stat mbeans.","messagePattern":"Could not retrieve list of stat mbeans\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/NodeProbe.java","lineNumber":871,"sourceCode":"\n    public double[] getAndResetGCStats()\n    {\n        return gcProxy.getAndResetStats();\n    }\n\n    public Iterator<Map.Entry<String, ColumnFamilyStoreMBean>> getColumnFamilyStoreMBeanProxies()\n    {\n        try\n        {\n            return new ColumnFamilyStoreMBeanIterator(mbeanServerConn);\n        }\n        catch (MalformedObjectNameException e)\n        {\n            throw new RuntimeException(\"Invalid ObjectName? Please report this as a bug.\", e);\n        }\n        catch (IOException e)\n        {\n            throw new RuntimeException(\"Could not retrieve list of stat mbeans.\", e);\n        }\n    }\n\n    public CompactionManagerMBean getCompactionManagerProxy()\n    {\n      return compactionProxy;\n    }\n\n    public List<String> getTokens()\n    {\n        return ssProxy.getTokens();\n    }\n\n    public List<String> getTokens(String endpoint)\n    {\n        try\n        {\n            return ssProxy.getTokens(endpoint);","sourceCodeStart":853,"sourceCodeEnd":889,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/NodeProbe.java#L853-L889","documentation":"When listing ColumnFamilyStore MBeans fails with IOException — e.g. the JMX connection to the node broke mid-query — NodeProbe wraps it in this RuntimeException indicating the list of stat mbeans could not be retrieved.","triggerScenarios":"Calling methods that enumerate table stats (tablestats, cfstats paths) when mbeanServerConn.queryNames/connection fails with IOException: JMX connection dropped, remote node restarted, or RMI/network failure mid-call.","commonSituations":"Node restarted while nodetool was running; network partition between client and node; JMX port/firewall issues; SSL/RMI handshake failure on long-running connections.","solutions":["Re-run the nodetool command","Verify the node is up and JMX is reachable (check JMX_PORT, firewall, jmxremote options)","Reconnect with fresh credentials/connection (restart nodetool)","Check node logs for GC pauses or restarts that dropped the JMX session"],"exampleFix":"// before\nnodetool tablestats   # node restarting mid-call\n// after\nnodetool status && nodetool tablestats","handlingStrategy":"retry","validationCode":"// Verify JMX reachability first\nJMXServiceURL url = new JMXServiceURL(\"service:jmx:rmi:///jndi/rmi://host:\" + port + \"/jmxrmi\");\ntry (JMXConnector c = JMXConnectorFactory.connect(url, env)) { /* ok */ }","typeGuard":null,"tryCatchPattern":"try {\n    probe.getColumnFamilyStoreMBeanProxies();\n} catch (RuntimeException e) {\n    if (e.getMessage().contains(\"Could not retrieve list of stat mbeans\")) {\n        Thread.sleep(backoffMs);\n        probe.getColumnFamilyStoreMBeanProxies(); // retry\n    } else throw e;\n}","preventionTips":["Verify node health before long stat-gathering commands","Keep JMX port reachable across firewalls","Watch for node restarts/GC pauses during nodetool runs","Configure stable JMX auth/SSL settings"],"tags":["jmx","io","connection"],"backgroundTag":"connection-refused","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}