{"record":{"id":"5817dae3b2b02691","repo":"apache/cassandra","slug":"invalid-parameter-param","errorCode":null,"errorMessage":"Invalid parameter ${param}","messagePattern":"Invalid parameter (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"tools/stress/src/org/apache/cassandra/stress/settings/GroupedOptions.java","lineNumber":70,"sourceCode":"        for (Option option : options())\n            if (!option.happy())\n                return false;\n        return true;\n    }\n\n    public abstract List<? extends Option> options();\n\n    // hands the parameters to each of the option groups, and returns the first provided\n    // option group that is happy() after this is done, that also accepted all the parameters\n    public static <G extends GroupedOptions> G select(String[] params, G... groupings)\n    {\n        for (String param : params)\n        {\n            boolean accepted = false;\n            for (GroupedOptions grouping : groupings)\n                accepted |= grouping.accept(param);\n            if (!accepted)\n                throw new IllegalArgumentException(\"Invalid parameter \" + param);\n        }\n        for (G grouping : groupings)\n            if (grouping.happy() && grouping.accepted == params.length)\n                return grouping;\n        return null;\n    }\n\n    // pretty prints all of the option groupings\n    public static void printOptions(PrintStream out, String command, GroupedOptions... groupings)\n    {\n        out.println();\n        boolean firstRow = true;\n        for (GroupedOptions grouping : groupings)\n        {\n            if (!firstRow)\n            {\n                out.println(\" OR \");\n            }","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/tools/stress/src/org/apache/cassandra/stress/settings/GroupedOptions.java#L52-L88","documentation":"GroupedOptions.select tries every param against each option grouping; any parameter not accepted by any grouping is invalid, and the method throws IllegalArgumentException naming it. This is the generic 'unknown option' failure of cassandra-stress grouped CLI option parsing.","triggerScenarios":"Passing an unrecognized option/flag to a stress subcommand, e.g. stress write -foo=bar, or misspelling an option name so no grouping accepts it.","commonSituations":"Typo'd flags on the stress command line; copying options valid for one subcommand to another; outdated option names after version upgrades.","solutions":["Fix or remove the offending parameter on the command line","Run the subcommand with no args or -h to print its valid options","Check the option name against the current version's documentation (options change between versions)"],"exampleFix":"// before\nstress write -cl=QUORUM -wrongopt=5\n// after\nstress write -cl=QUORUM -pop seq=1..1000","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { G opts = GroupedOptions.select(params, groupings); }\ncatch (IllegalArgumentException e) { System.err.println(\"Unknown option: \" + e.getMessage() + \"; run with -h for usage\"); System.exit(2); }","preventionTips":["Check option names with the subcommand's -h help output","Copy options only from docs matching your Cassandra version","Watch for shell quoting mangling flag names"],"tags":["cli","argument-parsing"],"backgroundTag":"invalid-cli-argument","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}