{"record":{"id":"cc67f3529b0f31aa","repo":"apache/cassandra","slug":"invalid-value-s-for-option-s-cc67f3","errorCode":null,"errorMessage":"Invalid value %s for option '%s'","messagePattern":"Invalid value (.+?) for option '(.+?)'","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/reads/SpeculativeRetryPolicy.java","lineNumber":59,"sourceCode":"\n    public static SpeculativeRetryPolicy fromString(String str)\n    {\n        if (AlwaysSpeculativeRetryPolicy.stringMatches(str))\n            return AlwaysSpeculativeRetryPolicy.INSTANCE;\n\n        if (NeverSpeculativeRetryPolicy.stringMatches(str))\n            return NeverSpeculativeRetryPolicy.INSTANCE;\n\n        if (PercentileSpeculativeRetryPolicy.stringMatches(str))\n            return PercentileSpeculativeRetryPolicy.fromString(str);\n\n        if (FixedSpeculativeRetryPolicy.stringMatches(str))\n            return FixedSpeculativeRetryPolicy.fromString(str);\n\n        if (HybridSpeculativeRetryPolicy.stringMatches(str))\n            return HybridSpeculativeRetryPolicy.fromString(str);\n\n        throw new ConfigurationException(String.format(\"Invalid value %s for option '%s'\", str, TableParams.Option.SPECULATIVE_RETRY));\n    }\n}\n","sourceCodeStart":41,"sourceCodeEnd":62,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/reads/SpeculativeRetryPolicy.java#L41-L62","documentation":"Fallback thrown by SpeculativeRetryPolicy.fromString when the speculative_retry string matches none of the known policy forms: NONE, ALWAYS, a fixed time ('XXms'), a percentile ('XXp'/'XXPERCENTILE'), or a MIN/MAX hybrid. It means the option value's syntax is simply unrecognized.","triggerScenarios":"speculative_retry set to a misspelled or legacy value such as '99percentile' (lowercase, no p), '500' without a unit, 'min(10ms,99p)' inside wrong quotes, or empty string via TableParams from a config/CQL statement.","commonSituations":"Upgrading from very old Cassandra versions where only 'milliseconds' or 'percentile' spellings existed; hand-edited schema files; driver-generated ALTER statements with locale-formatted numbers (e.g. '99,9p').","solutions":["Use one of the accepted forms: NONE, ALWAYS, '50ms', '99p' (or '99PERCENTILE'), 'MIN(50ms, 99p)'","Strip whitespace and verify the unit suffix is exactly 'ms' for fixed values","Re-run DESCRIBE TABLE to copy the exact current value format as a template"],"exampleFix":"// before\nALTER TABLE ks.tbl WITH speculative_retry = '99PERCENT';\n// after\nALTER TABLE ks.tbl WITH speculative_retry = '99PERCENTILE';","handlingStrategy":"validation","validationCode":"const SPECULATIVE_RETRY_RE = /^(NONE|ALWAYS|[0-9]*\\.?[0-9]+ms|[0-9]*\\.?[0-9]+p|[0-9]*\\.?[0-9]+PERCENTILE|(MIN|MAX)\\([^)]+,[^)]+\\))$/i;\nfunction validateSpeculativeRetry(v) { if (!SPECULATIVE_RETRY_RE.test(v.trim())) throw new Error(`unrecognized speculative_retry: ${v}`); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Maintain a whitelist of accepted values in schema-generation code","Migrate legacy spellings ('percentile', unitless numbers) during upgrade scripts","Test ALTER TABLE statements against a dev cluster before prod rollout"],"tags":["configuration","cql","speculative-retry","parsing"],"backgroundTag":"invalid-enum-value","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"}