{"record":{"id":"00d037cc3dfee012","repo":"apache/cassandra","slug":"invalid-value-s-for-option-s","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/FixedSpeculativeRetryPolicy.java","lineNumber":89,"sourceCode":"        return String.format(\"%dms\", speculateAtMilliseconds);\n    }\n\n    static FixedSpeculativeRetryPolicy fromString(String str)\n    {\n        Matcher matcher = PATTERN.matcher(str);\n\n        if (!matcher.matches())\n            throw new IllegalArgumentException();\n\n        String val = matcher.group(\"val\");\n        try\n        {\n             // historically we've always parsed this as double, but treated as int; so we keep doing it for compatibility\n            return new FixedSpeculativeRetryPolicy((int) Double.parseDouble(val));\n        }\n        catch (IllegalArgumentException e)\n        {\n            throw new ConfigurationException(String.format(\"Invalid value %s for option '%s'\", str, TableParams.Option.SPECULATIVE_RETRY));\n        }\n    }\n\n    static boolean stringMatches(String str)\n    {\n        return PATTERN.matcher(str).matches();\n    }\n}\n","sourceCodeStart":71,"sourceCodeEnd":98,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/reads/FixedSpeculativeRetryPolicy.java#L71-L98","documentation":"FixedSpeculativeRetryPolicy.fromString parses the SPECULATIVE_RETRY table option's fixed-millisecond forms (e.g. '50ms'). On failure it throws ConfigurationException 'Invalid value %s for option 'speculative_retry''.","triggerScenarios":"CREATE/ALTER TABLE with SPECULATIVE_RETRY set to an unparseable value like '50' (missing ms), '50milliseconds', or other text not matching the pattern.","commonSituations":"Copy-pasting option values from older documentation or other systems, typos, and scripts generated with wrong units.","solutions":["Use the accepted format: a number followed by 'ms', e.g. SPECULATIVE_RETRY = '50ms'","Query system_schema.tables for the current valid value as a reference","For percentage-style behavior use the PERCENTILE form (e.g. '99PERCENTILE') handled by a different policy","Validate the value in tooling before issuing schema changes"],"exampleFix":"// before\nALTER TABLE ks.tbl WITH speculative_retry = '50';\n// after\nALTER TABLE ks.tbl WITH speculative_retry = '50ms';","handlingStrategy":"validation","validationCode":"// client-side validation before ALTER TABLE\nPattern p = Pattern.compile(\"\\\\d+ms\");\nif (!p.matcher(speculativeRetry).matches()) throw new IllegalArgumentException(\"use e.g. '50ms'\");","typeGuard":null,"tryCatchPattern":"try { session.execute(alter); } catch (com.datastax.driver.core.exceptions.InvalidQueryException e) { if (e.getMessage().contains(\"speculative_retry\")) fixAndRetry(); else throw e; }","preventionTips":["Always include the 'ms' unit on fixed speculative_retry values","Pull example values from current official docs, not older posts","Lint generated CQL for table option formats","Test schema changes on a dev cluster first"],"tags":["cql","schema","config"],"backgroundTag":"invalid-config-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"}