{"record":{"id":"dd32ad171bd4b19b","repo":"apache/cassandra","slug":"error-occured-when-setting-the-config-for-setter","errorCode":null,"errorMessage":"Error occured when setting the config for setter %s with arguments %s: %s","messagePattern":"Error occured when setting the config for setter (.+?) with arguments (.+?): (.+?)","errorType":"console","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/nodetool/GuardrailsConfigCommand.java","lineNumber":222,"sourceCode":"                                                .orElseThrow(() -> new IllegalStateException(format(\"Guardrail %s not found.\", snakeCaseName)));\n\n            sanitizeArguments(setter, args);\n            validateArguments(setter, snakeCaseName, args);\n\n            List<String> methodArgs = args.subList(1, args.size());\n            try\n            {\n                setter.invoke(probe.getGuardrailsMBean(), prepareArguments(methodArgs, setter));\n            }\n            catch (Exception ex)\n            {\n                String reason;\n                if (ex.getCause() != null && ex.getCause().getMessage() != null)\n                    reason = ex.getCause().getMessage();\n                else\n                    reason = ex.getMessage();\n\n                throw new IllegalStateException(format(\"Error occured when setting the config for setter %s with arguments %s: %s\",\n                                                       snakeCaseName, methodArgs, reason));\n            }\n        }\n\n        @Override\n        public void addRow(List<InternalRow> bucket, GuardrailsMBean mBean, List<Method> methods, String guardrailName) throws Throwable\n        {\n            if (methods.size() == 1)\n            {\n                Method method = methods.get(0);\n                if (method.getParameterTypes().length == 1)\n                    constructRow(bucket, sanitizeSetterName(method), method.getParameterTypes()[0].getName());\n                else\n                    constructRow(bucket, sanitizeSetterName(method), stream(method.getParameterTypes()).map(Class::getName).collect(toList()).toString());\n            }\n        }\n\n        private Map<String, List<Method>> getAllSetters(NodeProbe probe)","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/nodetool/GuardrailsConfigCommand.java#L204-L240","documentation":"When invoking a guardrail setter fails, the set subcommand wraps the underlying exception's cause message into IllegalStateException 'Error occured when setting the config for setter <name> with arguments <args>: <reason>'. The reason is the actual server-side failure (e.g. value rejected by the guardrail setter).","triggerScenarios":"Calling `nodetool guardrailsconfig set <name> <values>` where the reflective MBean setter call throws — e.g. an invalid value, wrong value type, or guardrail constraint violation on the server.","commonSituations":"Passing a value the setter rejects (out-of-range, malformed set syntax); wrong number/format of values; guardrail disabled or removed on the server.","solutions":["Read the embedded reason in the message and fix the offending value.","Validate the value against the guardrail's documented constraints in cassandra.yaml/docs.","Confirm the setter exists and its parameter types in the matching Cassandra version."],"exampleFix":"// before\nnodetool guardrailsconfig set read_consistency_level BOGUS\n// after\nnodetool guardrailsconfig set read_consistency_level EACH_QUORUM","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    run(['nodetool','guardrailsconfig','set',name]+values)\nexcept subprocess.CalledProcessError as e:\n    # stderr contains 'Error occured when setting the config for setter ...: <reason>'\n    sys.exit(f'setting guardrail {name} failed: {e.stderr.split(\": \")[-1]}')","preventionTips":["Validate values against the guardrail's documented constraints before setting.","Confirm the setter's parameter types for your Cassandra version."],"tags":["cli","nodetool","guardrails","setter","reflection"],"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"}