{"record":{"id":"895f6d0ceb602ffc","repo":"apache/cassandra","slug":"error-occured-when-getting-the-guardrails-config","errorCode":null,"errorMessage":"Error occured when getting the guardrails config","messagePattern":"Error occured when getting the guardrails config","errorType":"console","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/nodetool/GuardrailsConfigCommand.java","lineNumber":467,"sourceCode":"            else\n            {\n                if (holder.values().stream().flatMap(list -> Stream.of(list.toArray(new InternalRow[0]))).count() == 1)\n                {\n                    for (Map.Entry<GuardrailCategory, List<InternalRow>> entry : holder.entrySet())\n                        populateOne(tb, entry.getValue());\n                }\n                else\n                {\n                    for (Map.Entry<GuardrailCategory, List<InternalRow>> entry : holder.entrySet())\n                        populateTable(tb, entry.getValue());\n                }\n            }\n\n            tb.printTo(probe.output().out);\n        }\n        catch (Throwable e)\n        {\n            throw new RuntimeException(\"Error occured when getting the guardrails config\", e);\n        }\n    }\n\n    private void populateTable(TableBuilder tableBuilder, List<InternalRow> bucket)\n    {\n        for (InternalRow row : bucket)\n            tableBuilder.add(row.name, row.value);\n    }\n\n    private void populateOne(TableBuilder tableBuilder, List<InternalRow> bucket)\n    {\n        if (bucket.size() == 1)\n            tableBuilder.add(bucket.get(0).value);\n    }\n\n    void constructRow(List<InternalRow> bucket, String guardrailName, String value)\n    {\n        bucket.add(new InternalRow(guardrailName, value));","sourceCodeStart":449,"sourceCodeEnd":485,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/nodetool/GuardrailsConfigCommand.java#L449-L485","documentation":"GuardrailsConfigCommand.display wraps its whole table-building and JMX-consulting logic in a try/catch and rethrows any Throwable as RuntimeException('Error occured when getting the guardrails config'). It is a catch-all indicating the nodetool client failed to retrieve guardrails configuration from the node, typically via NodeProbe/JMX, and the real cause is attached as the suppressed root exception.","triggerScenarios":"Running `nodetool guardrails-config` when the JMX connection fails or the remote call throws: node down, wrong host/port, JMX auth failure, MBean missing (older server version without guardrails), or an exception while rendering the internal rows.","commonSituations":"Pointing nodetool at a node where the storage proxy/JMX service is not up; running a newer nodetool against an older Cassandra that lacks the guardrails MBean; wrong credentials in nodetool/JMX config; firewall blocking port 7199.","solutions":["Read the chained 'Caused by' stack trace to find the real failure","Verify the node is up and JMX is reachable (nodetool status against the same host/port/credentials)","Use a nodetool version matching the Cassandra server version so the guardrails MBean exists","If MBean/auth is the issue, fix cassandra-env.yml JMX settings or nodetool credentials"],"exampleFix":"// before\nnodetool -h prod-node-7 guardrails-config   # fails: JMX unreachable\n// after\nnodetool -h prod-node-7 -p 7199 -u jmxuser -pw jmxpass guardrails-config","handlingStrategy":"try-catch","validationCode":"// preflight: confirm JMX is reachable and the guardrails MBean exists\nnodetool -h $HOST -p 7199 info >/dev/null || { echo \"JMX unreachable\"; exit 1; }","typeGuard":null,"tryCatchPattern":"try { runNodetool(\"guardrails-config\"); } catch (RuntimeException e) {\n    Throwable root = e; while (root.getCause()!=null) root=root.getCause();\n    log(\"guardrails-config failed: \" + root); // inspect real cause\n}","preventionTips":["Always read the 'Caused by' chain — this message is only a wrapper","Preflight JMX connectivity before nodetool commands","Match nodetool version to the Cassandra server version (guardrails requires 4.1+)"],"tags":["nodetool","jmx","guardrails","connection"],"backgroundTag":"api-request-failed","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"}