{"record":{"id":"a993fa0f83d18f01","repo":"apache/cassandra","slug":"invalid-parameter-list-for-sequence-distribution","errorCode":null,"errorMessage":"Invalid parameter list for sequence distribution: ","messagePattern":"Invalid parameter list for sequence distribution: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"tools/stress/src/org/apache/cassandra/stress/settings/OptionDistribution.java","lineNumber":377,"sourceCode":"            try\n            {\n                final long key = parseLong(params.get(0));\n                return new FixedFactory(key);\n            } catch (Exception ignore)\n            {\n                throw new IllegalArgumentException(\"Invalid parameter list for fixed distribution: \" + params);\n            }\n        }\n    }\n\n    private static final class SequenceImpl implements Impl\n    {\n\n        @Override\n        public DistributionFactory getFactory(List<String> params)\n        {\n            if (params.size() != 1)\n                throw new IllegalArgumentException(\"Invalid parameter list for sequence distribution: \" + params);\n            final long min;\n            final long max;\n            try\n            {\n                String[] bounds = params.get(0).split(\"\\\\.\\\\.+\");\n                min = parseLong(bounds[0]);\n                max = parseLong(bounds[1]);\n            } catch (Exception ignore)\n            {\n                throw new IllegalArgumentException(\"Invalid parameter list for sequence distribution: \" + params);\n            }\n            if (min == max)\n                throw new IllegalArgumentException(\"Invalid parameter list for sequence distribution (min==max): \" + params);\n\n            if (min > max)\n                throw new IllegalArgumentException(\"Invalid parameter list for sequence distribution (min>max): \" + params);\n\n            return new SequenceFactory(min, max);","sourceCodeStart":359,"sourceCodeEnd":395,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/tools/stress/src/org/apache/cassandra/stress/settings/OptionDistribution.java#L359-L395","documentation":"The sequence distribution impl (SEQ(min..max)) requires exactly one parameter containing a 'min..max' range. This throw happens when the params list size is not 1, i.e. the sequence spec was passed zero or multiple parameter tokens.","triggerScenarios":"cassandra-stress invoked with a seq distribution spec whose parameter list has zero or more than one element, e.g. 'SEQ()' or the range string split into separate args.","commonSituations":"Shell splitting the '..' range into two tokens; forgetting the parentheses entirely; mixing sequence with fixed-style single-value syntax.","solutions":["Quote the spec so the shell passes it as one token: -pop 'seq=SEQ(1..1000000)'","Provide the range inside parentheses with .. separator: SEQ(min..max)","Check for stray spaces inside the spec that tokenize it into multiple params."],"exampleFix":"// before\n-pop seq=SEQ(1 ..1000)   # splits into multiple params\n// after\n-pop seq=SEQ(1..1000)","handlingStrategy":"validation","validationCode":"boolean isValidSeqSpec(String s){ if (s.chars().filter(c==',').count()!=0) ...; return s.matches(\".*\\\\(\\\\s*-?\\\\d+\\\\.\\\\.-?\\\\d+\\\\s*\\\\)\"); }","typeGuard":null,"tryCatchPattern":"try { DistributionFactory f = seq.getFactory(params); } catch (IllegalArgumentException e) { reportSpecError(e); }","preventionTips":["Quote distribution specs on the command line","Avoid spaces inside SEQ(...)","Verify the '..' separator is intact after shell expansion"],"tags":["cli","argument-validation","distribution"],"backgroundTag":"invalid-argument-format","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"}