{"record":{"id":"9db0cb89c561c379","repo":"apache/cassandra","slug":"unsupported-type-s","errorCode":null,"errorMessage":"unsupported type: %s","messagePattern":"unsupported type: (.+?)","errorType":"console","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/nodetool/GuardrailsConfigCommand.java","lineNumber":334,"sourceCode":"            else if (targetType == boolean.class || targetType == Boolean.class)\n            {\n                return getNumber(value, (v) -> {\n                    if (!v.equals(\"true\") && !v.equals(\"false\"))\n                        throw new IllegalStateException(\"Use 'true' or 'false' values for booleans\");\n\n                    return Boolean.parseBoolean(v);\n                }, false);\n            }\n            else if (targetType == Set.class)\n            {\n                if (value == null || value.equals(\"null\") || value.equals(\"[]\"))\n                    return new HashSet<>();\n                else\n                    return new LinkedHashSet<>(Arrays.asList(value.split(\",\")));\n            }\n            else\n            {\n                throw new IllegalArgumentException(format(\"unsupported type: %s\", targetType));\n            }\n        }\n\n        private <T> T getNumber(String value, Function<String, T> transformer, T defaultValue)\n        {\n            if (value == null || value.equals(\"null\"))\n                return defaultValue;\n\n            try\n            {\n                return transformer.apply(value);\n            }\n            catch (NumberFormatException ex)\n            {\n                throw new IllegalStateException(format(\"Unable to parse value %s\", value), ex);\n            }\n        }\n    }","sourceCodeStart":316,"sourceCodeEnd":352,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/nodetool/GuardrailsConfigCommand.java#L316-L352","documentation":"nodetool GuardrailsConfigCommand casts a user-supplied string option into a Java collection type (Set/HashSet/LinkedHashSet) when preparing arguments for the guardrails config call. If the option's declared targetType is not one of the supported collection/string types, castType throws IllegalArgumentException with the unsupported type name. It is a developer/CLI-metdata bug, not a user input problem: the type must come from the command's own parameter definitions.","triggerScenarios":"Running `nodetool guardrails-config` set/get paths where an option's configured type is anything other than the supported Set types or String, e.g. a new guardrail parameter added with List or Map type that castType was never extended to handle.","commonSituations":"Extending GuardrailsConfigCommand with a new guardrail property whose value type is not a comma-separated set; copy-pasting a parameter definition with the wrong type; version drift between nodetool client and server guardrail configuration.","solutions":["Change the guardrail option's declared type to a supported one (String or Set, comma-separated values)","Add a castType branch for the missing targetType so it is converted explicitly","Downgrade/upgrade so nodetool and the server use matching versions of the tooling","Run the command without the offending option and set the guardrail via cassandra.yaml or JMX instead"],"exampleFix":"// before\ncastListArg(options, \"disallowed-compare-operators\", List.class);\n// after\n// use a supported type\ncastSetArg(options, \"disallowed-compare-operators\", Set.class);","handlingStrategy":"validation","validationCode":"// before invoking nodetool guardrails-config, ensure the option value is a supported type (string or comma-separated set)\nif (!List.of(\"String\",\"Set\").contains(optionType))\n    throw new IllegalArgumentException(\"Option type not supported by castType: \" + optionType);","typeGuard":"if (value instanceof String || value instanceof java.util.Set) { /* proceed */ }","tryCatchPattern":"try { runNodetool(\"guardrails-config\", args); } catch (IllegalArgumentException e) { log(\"Unsupported guardrail type: \" + e.getMessage()); }","preventionTips":["Only pass string or comma-separated set values to guardrails-config options","Keep nodetool and server versions aligned","When adding new guardrail params, extend castType in the same change"],"tags":["nodetool","cli","type-mismatch","guardrails"],"backgroundTag":"unsupported-operation","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}