{"record":{"id":"6f68c917c90247f0","repo":"apache/cassandra","slug":"s-is-not-a-parsable-int-base10-for-s-6f68c9","errorCode":null,"errorMessage":"%s is not a parsable int (base10) for %s","messagePattern":"(.+?) is not a parsable int \\(base10\\) for (.+?)","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/db/compaction/TimeWindowCompactionStrategyOptions.java","lineNumber":133,"sourceCode":"\n        }\n        catch (IllegalArgumentException e)\n        {\n            throw new ConfigurationException(String.format(\"%s is not valid for %s\", optionValue, COMPACTION_WINDOW_UNIT_KEY), e);\n        }\n\n        optionValue = options.get(COMPACTION_WINDOW_SIZE_KEY);\n        try\n        {\n            int sstableWindowSize = optionValue == null ? DEFAULT_COMPACTION_WINDOW_SIZE : Integer.parseInt(optionValue);\n            if (sstableWindowSize < 1)\n            {\n                throw new ConfigurationException(String.format(\"%d must be greater than 1 for %s\", sstableWindowSize, COMPACTION_WINDOW_SIZE_KEY));\n            }\n        }\n        catch (NumberFormatException e)\n        {\n            throw new ConfigurationException(String.format(\"%s is not a parsable int (base10) for %s\", optionValue, COMPACTION_WINDOW_SIZE_KEY), e);\n        }\n\n        optionValue = options.get(EXPIRED_SSTABLE_CHECK_FREQUENCY_SECONDS_KEY);\n        try\n        {\n            long expiredCheckFrequency = optionValue == null ? DEFAULT_EXPIRED_SSTABLE_CHECK_FREQUENCY_SECONDS : Long.parseLong(optionValue);\n            if (expiredCheckFrequency < 0)\n            {\n                throw new ConfigurationException(String.format(\"%s must not be negative, but was %d\", EXPIRED_SSTABLE_CHECK_FREQUENCY_SECONDS_KEY, expiredCheckFrequency));\n             }\n        }\n        catch (NumberFormatException e)\n        {\n            throw new ConfigurationException(String.format(\"%s is not a parsable int (base10) for %s\", optionValue, EXPIRED_SSTABLE_CHECK_FREQUENCY_SECONDS_KEY), e);\n        }\n\n\n        optionValue = options.get(UNSAFE_AGGRESSIVE_SSTABLE_EXPIRATION_KEY);","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/compaction/TimeWindowCompactionStrategyOptions.java#L115-L151","documentation":"TimeWindowCompactionStrategy (TWCS) throws this ConfigurationException when the compaction_window_size option cannot be parsed as a base-10 integer. It is raised inside validateOptions, which runs whenever a table is created/altered with TWCS or its options are validated, so a bad value fails fast at schema time rather than at compaction time.","triggerScenarios":"Calling validateOptions (via CREATE/ALTER TABLE ... WITH compaction = {'class':'TimeWindowCompactionStrategy','compaction_window_size':'...'}) with a compaction_window_size value that Integer.parseInt rejects, e.g. 'ten', '1.5', '10s', '', or a number too large for int.","commonSituations":"Typing the size with a unit suffix (e.g. '60m' or '1d'); copy-paste errors leaving whitespace; using a decimal like '1.5'; tools or IaC templates generating non-numeric defaults.","solutions":["Set compaction_window_size to a plain base-10 integer string, e.g. '1'","Remove unit suffixes or decimals from the value; units go in compaction_window_unit","Quote the option value correctly in CQL so no stray whitespace is included","Catch org.apache.cassandra.exceptions.ConfigurationException around the schema change to surface a friendlier message"],"exampleFix":"// before\nALTER TABLE ks.t WITH compaction = {'class':'TimeWindowCompactionStrategy','compaction_window_size':'1d','compaction_window_unit':'DAYS'};\n// after\nALTER TABLE ks.t WITH compaction = {'class':'TimeWindowCompactionStrategy','compaction_window_size':'1','compaction_window_unit':'DAYS'};","handlingStrategy":"validation","validationCode":"if (opts.containsKey(\"compaction_window_size\") && !opts.get(\"compaction_window_size\").trim().matches(\"\\\\d+\"))\n    throw new IllegalArgumentException(\"compaction_window_size must be a plain base-10 integer\");","typeGuard":"static boolean isPlainInt(String s) { if (s == null) return false; try { Integer.parseInt(s.trim()); return true; } catch (NumberFormatException e) { return false; } }","tryCatchPattern":"try {\n    session.execute(\"ALTER TABLE ks.t WITH compaction = {...}\");\n} catch (com.datastax.driver.core.exceptions.InvalidQueryException e) {\n    // driver surfaces server ConfigurationException as InvalidQueryException; check message for compaction_window_size\n}","preventionTips":["Never append unit suffixes to compaction_window_size; units belong in compaction_window_unit","Regex-validate integer options in any IaC/tooling that generates table options","Test table option changes on a dev keyspace first","Trim and strip quotes from option values before sending"],"tags":["cassandra","configuration","compaction","numberformat"],"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"}