{"record":{"id":"0cfa2e6bdfe54a46","repo":"apache/cassandra","slug":"unsupported-data-storage-unit-s-supported-units","errorCode":null,"errorMessage":"Unsupported data storage unit: %s. Supported units are: %s","messagePattern":"Unsupported data storage unit: (.+?)\\. Supported units are: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DataStorageSpec.java","lineNumber":648,"sourceCode":"            assert (over > 0) && (over < (MAX-1L)) && (over == (MAX / m));\n\n            if (d > over)\n                return Long.MAX_VALUE;\n            return Math.multiplyExact(d, m);\n        }\n\n        /**\n         * @param symbol the unit symbol\n         * @return the memory unit corresponding to the given symbol\n         */\n        public static DataStorageUnit fromSymbol(String symbol)\n        {\n            for (DataStorageUnit value : values())\n            {\n                if (value.symbol.equalsIgnoreCase(symbol))\n                    return value;\n            }\n            throw new IllegalArgumentException(String.format(\"Unsupported data storage unit: %s. Supported units are: %s\",\n                                                           symbol, Arrays.stream(values())\n                                                                         .map(u -> u.symbol)\n                                                                         .collect(Collectors.joining(\", \"))));\n        }\n\n        static final long MAX = Long.MAX_VALUE;\n\n        /**\n         * The unit symbol\n         */\n        private final String symbol;\n\n        DataStorageUnit(String symbol)\n        {\n            this.symbol = symbol;\n        }\n\n        public String getSymbol()","sourceCodeStart":630,"sourceCodeEnd":666,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DataStorageSpec.java#L630-L666","documentation":"DataStorageSpec parses storage values as number + unit symbol (B, KiB, MiB, GiB, TiB, PB etc.). fromSymbol throws this IllegalArgumentException when the unit suffix in the string does not match any known DataStorageUnit symbol, listing all supported symbols.","triggerScenarios":"Parsing a config value like '100 MB' or '10 kilobytes' or '512kb' (case is handled, but the symbol must exist), or calling DataStorageSpec.DataStorageUnit.fromSymbol(\"KB\") directly with an unrecognized symbol.","commonSituations":"Using decimal symbols (KB, MB) instead of the binary ones Cassandra expects (KiB, MiB), misspelling units (Mib, Gb), or copying configs from tools that use different unit conventions.","solutions":["Use the exact supported symbols shown in the error message (e.g. KiB, MiB, GiB)","Replace decimal-style units: MB -> MiB, KB -> KiB","Fix typos in the unit suffix in cassandra.yaml"],"exampleFix":"// before (cassandra.yaml)\ncommitlog_total_space_in_mb: 512MB\n// after\ncommitlog_total_space: 512MiB","handlingStrategy":"validation","validationCode":"String UNIT_RE = \"^(B|KiB|MiB|GiB|TiB|PiB)$\"; if (!unit.matches(UNIT_RE)) throw new IllegalArgumentException(\"unsupported unit: \" + unit);","typeGuard":null,"tryCatchPattern":"try { DataStorageSpec.parse(\"512MiB\"); } catch (IllegalArgumentException e) { /* show supported units from e.getMessage() */ }","preventionTips":["Use only Cassandra's binary unit symbols (KiB, MiB, GiB) not decimal (KB, MB)","Copy unit spellings from the shipped cassandra.yaml examples","Lint config files for unit suffixes before deploy"],"tags":["cassandra","config","units","invalid-enum-value"],"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-14T16:17:12.679Z"}