{"record":{"id":"4e61c173090bd873","repo":"apache/cassandra","slug":"s-is-not-a-valid-number-between-0-and-1-s","errorCode":null,"errorMessage":"%s is not a valid number between 0 and 1: %s","messagePattern":"(.+?) is not a valid number between 0 and 1: (.+?)","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/db/compaction/unified/Controller.java","lineNumber":662,"sourceCode":"            }\n        }\n\n        s = options.remove(SSTABLE_GROWTH_OPTION);\n        if (s != null)\n        {\n            try\n            {\n                double targetSSTableGrowth  = FBUtilities.parsePercent(s);\n                if (targetSSTableGrowth < 0 || targetSSTableGrowth > 1)\n                {\n                    throw new ConfigurationException(String.format(\"%s %s must be between 0 and 1\",\n                                                                   SSTABLE_GROWTH_OPTION,\n                                                                   s));\n                }\n            }\n            catch (NumberFormatException e)\n            {\n                throw new ConfigurationException(String.format(\"%s is not a valid number between 0 and 1: %s\",\n                                                               SSTABLE_GROWTH_OPTION,\n                                                               e.getMessage()),\n                                                 e);\n            }\n        }\n\n        return options;\n    }\n\n    private static void validateBoolean(Map<String, String> options, String option)\n    {\n        String s;\n        s = options.remove(option);\n        if (s != null && !s.equalsIgnoreCase(\"true\") && !s.equalsIgnoreCase(\"false\")) {\n            throw new ConfigurationException(String.format(\"%s should either be 'true' or 'false', not %s\",\n                    option, s));\n        }\n    }","sourceCodeStart":644,"sourceCodeEnd":680,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/compaction/unified/Controller.java#L644-L680","documentation":"The unified compaction controller validates the 'sstable_growth' option by parsing it with FBUtilities.parsePercent. If the string is not a valid number/percentage at all (e.g. 'high', '0,5'), the resulting NumberFormatException is rethrown as a ConfigurationException identifying the option.","triggerScenarios":"Calling validateOptions with an sstable_growth value that cannot be parsed as a number or percentage, such as 'fast' or '0,5' with a comma decimal separator.","commonSituations":"Free-text config values, comma-vs-dot decimal locale mistakes, truncation by templating tools, or editing the option by hand.","solutions":["Set sstable_growth to a valid numeric value between 0 and 1, e.g. '0.3' or '30%'.","Use a dot as the decimal separator, not a comma.","Remove the option to fall back to the default.","Inspect the cause's message (e.getMessage()) for the exact parse failure."],"exampleFix":"// before\ncompaction = {'class': 'UnifiedCompactionStrategy', 'sstable_growth': '0,3'};\n// after\ncompaction = {'class': 'UnifiedCompactionStrategy', 'sstable_growth': '0.3'};","handlingStrategy":"validation","validationCode":"String v = options.get(\"sstable_growth\");\nif (v != null) {\n    try { Double.parseDouble(v.replace(\"%\", \"\")); }\n    catch (NumberFormatException e) { throw new IllegalArgumentException(\"sstable_growth must be numeric: \" + v); }\n}","typeGuard":null,"tryCatchPattern":"try { strategy.validateOptions(opts); } catch (ConfigurationException e) { logger.error(\"Unparseable sstable_growth: {}\", e.getMessage()); }","preventionTips":["Always use '.' as decimal separator in configs","Quote and escape values in generated CQL","Unit-test config generators with strict parsers"],"tags":["cassandra","configuration","compaction","parsing"],"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"}