{"record":{"id":"3f466fde6fbbf0ef","repo":"apache/cassandra","slug":"invalid-configuration-s-should-be-greater-than-o","errorCode":null,"errorMessage":"Invalid configuration, %s should be greater than or equal to 0 (zero)","messagePattern":"Invalid configuration, (.+?) should be greater than or equal to 0 \\(zero\\)","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/db/compaction/unified/Controller.java","lineNumber":629,"sourceCode":"                Overlaps.InclusionMethod.valueOf(toUpperCaseLocalized(s));\n            }\n            catch (IllegalArgumentException e)\n            {\n                throw new ConfigurationException(String.format(\"Invalid overlap inclusion method %s. The valid options are %s.\",\n                                                               s,\n                                                               Arrays.toString(Overlaps.InclusionMethod.values())));\n            }\n        }\n\n        s = options.remove(MIN_SSTABLE_SIZE_OPTION);\n        if (s != null)\n        {\n            try\n            {\n                long sizeInBytes = FBUtilities.parseHumanReadableBytes(s);\n                // zero is a valid option to disable feature\n                if (sizeInBytes < 0)\n                    throw new ConfigurationException(String.format(\"Invalid configuration, %s should be greater than or equal to 0 (zero)\",\n                                                                   MIN_SSTABLE_SIZE_OPTION));\n                long limit = (long) Math.ceil(targetSSTableSize * INVERSE_SQRT_2);\n                if (sizeInBytes >= limit)\n                    throw new ConfigurationException(String.format(\"Invalid configuration, %s (%s) should be less than 70%% of the targetSSTableSize (%s)\",\n                                                                   MIN_SSTABLE_SIZE_OPTION,\n                                                                   FBUtilities.prettyPrintMemory(sizeInBytes),\n                                                                   FBUtilities.prettyPrintMemory(targetSSTableSize)));\n            }\n            catch (NumberFormatException e)\n            {\n                throw new ConfigurationException(String.format(\"%s is not a valid size in bytes for %s\",\n                                                               s,\n                                                               MIN_SSTABLE_SIZE_OPTION),\n                                                 e);\n            }\n        }\n\n        s = options.remove(SSTABLE_GROWTH_OPTION);","sourceCodeStart":611,"sourceCodeEnd":647,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/compaction/unified/Controller.java#L611-L647","documentation":"The min_sstable_size option of UnifiedCompactionStrategy must be zero or positive; negative byte values are rejected. Zero is explicitly valid and disables the feature. The value is parsed with FBUtilities.parseHumanReadableBytes.","triggerScenarios":"Setting compaction option 'min_sstable_size' to a parsed value < 0 in Controller.validateOptions — practically requires a malformed negative literal like '-1MiB' that still parses.","commonSituations":"Typing a leading dash intending a hyphen or bullet; templating bug emitting negative defaults; misunderstanding that 0 disables the feature while negatives are invalid.","solutions":["Set min_sstable_size to 0 to disable the feature, or a positive size.","Remove the option entirely for default behavior.","Fix the config generator to never emit negative sizes."],"exampleFix":"// before\n'min_sstable_size': '-1MiB'\n// after\n'min_sstable_size': '0'","handlingStrategy":"validation","validationCode":"long v = FBUtilities.parseHumanReadableBytes(opts.get(\"min_sstable_size\"));\nif (v < 0) throw new IllegalArgumentException(\"min_sstable_size must be >= 0\");","typeGuard":null,"tryCatchPattern":"try { alterTable(); } catch (ConfigurationException e) { logger.error(\"min_sstable_size invalid: {}\", e.getMessage()); }","preventionTips":["Use 0 to disable, never negative values","Sanitize generated config values for leading dashes","Validate all compaction sizes with parseHumanReadableBytes before applying"],"tags":["cassandra","configuration","compaction","validation"],"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-14T16:17:12.679Z"}