{"record":{"id":"6b7e1562b4928450","repo":"apache/cassandra","slug":"guardrail-s-not-found","errorCode":null,"errorMessage":"Guardrail %s not found.","messagePattern":"Guardrail (.+?) not found\\.","errorType":"console","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/nodetool/GuardrailsConfigCommand.java","lineNumber":81,"sourceCode":"        @Option(names = { \"--expand\" },\n        description = \"Expand all guardrail names so they reflect their counterparts in cassandra.yaml\")\n        private boolean expand = false;\n\n        @Parameters(index = \"0\", arity = \"0..1\", description = \"Specific name of a guardrail to get configuration of or all guardrails if not specified.\")\n        private String guardrailName;\n\n        @Override\n        public void execute(NodeProbe probe)\n        {\n            if (guardrailName != null && guardrailCategory != null)\n                throw new IllegalStateException(\"Do not specify additional arguments when --category/-c is set.\");\n\n            Map<String, List<Method>> allGetters = parseGuardrailNames(probe.getGuardrailsMBean().getClass().getDeclaredMethods(), guardrailName);\n\n            if (allGetters.isEmpty())\n            {\n                assert guardrailName != null;\n                throw new IllegalStateException(format(\"Guardrail %s not found.\", guardrailName));\n            }\n\n            display(probe, allGetters, guardrailCategory, expand);\n        }\n\n        @VisibleForTesting\n        public static Map<String, List<Method>> parseGuardrailNames(Method[] guardrailsMethods, String guardrailName)\n        {\n            Map<String, List<Method>> allGetters = stream(guardrailsMethods)\n                                                   .filter(method -> method.getName().startsWith(\"get\")\n                                                                     && !method.getName().endsWith(\"CSV\")\n                                                                     && !(method.getName().endsWith(\"WarnThreshold\") || method.getName().endsWith(\"FailThreshold\")))\n                                                   .filter(method -> guardrailName == null || guardrailName.equals(toSnakeCase(method.getName().substring(3))))\n                                                   .collect(Collectors.groupingBy(method -> toSnakeCase(method.getName().substring(3))));\n\n            // TODO for now remove custom guardrails\n            for (String ignore : ignored)\n                allGetters.remove(ignore);","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/nodetool/GuardrailsConfigCommand.java#L63-L99","documentation":"When querying a specific guardrail by name, nodetool guardrails-config looks up matching getter methods on the GuardrailsMBean; if none match it throws IllegalStateException 'Guardrail <name> not found.', meaning no such guardrail getter exists on the server.","triggerScenarios":"Running `nodetool guardrailsconfig get <name>` where <name> does not correspond to any declared getter method on the Guardrails MBean (typo or guardrail unavailable in this Cassandra version).","commonSituations":"Typo in the guardrail name; querying a guardrail introduced in a newer Cassandra release than the node runs; using camelCase where snake_case is expected (or vice versa).","solutions":["Run `nodetool guardrailsconfig` with no arguments to list all available guardrails and copy the exact name.","Check the Cassandra version's GuardrailsMBean for the correct name.","Fix the name's casing/naming convention to match the MBean getter."],"exampleFix":"// before\nnodetool guardrailsconfig get readconsistancylevel\n// after\nnodetool guardrailsconfig get read_consistency_level","handlingStrategy":"validation","validationCode":"available = subprocess.run(['nodetool','guardrailsconfig'], capture_output=True, text=True).stdout\ndef validate_guardrail(name):\n    if name not in available:\n        raise SystemExit(f'unknown guardrail: {name}')","typeGuard":null,"tryCatchPattern":"try:\n    run(['nodetool','guardrailsconfig','get',name])\nexcept subprocess.CalledProcessError:\n    sys.exit(f'guardrail {name!r} not found on this node/version')","preventionTips":["List guardrails first (`nodetool guardrailsconfig`) before querying a specific one.","Keep nodetool and server versions aligned."],"tags":["cli","nodetool","guardrails","not-found"],"backgroundTag":"entity-not-found","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"}