{"record":{"id":"9da37c36839cf58a","repo":"apache/cassandra","slug":"max-value-size-must-be-positive","errorCode":null,"errorMessage":"max_value_size must be positive","messagePattern":"max_value_size must be positive","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":1173,"sourceCode":"        if (conf.jmx_server_options == null)\n        {\n            conf.jmx_server_options = JMXServerOptions.createParsingSystemProperties();\n        }\n        else if (JMXServerOptions.isEnabledBySystemProperties())\n        {\n                throw new ConfigurationException(\"Configure either jmx_server_options in cassandra.yaml and comment out \" +\n                                                 \"configure_jmx function call in cassandra-env.sh or keep cassandra-env.sh \" +\n                                                 \"to call configure_jmx function but you have to keep jmx_server_options \" +\n                                                 \"in cassandra.yaml commented out.\");\n        }\n\n        conf.jmx_server_options.jmx_encryption_options.applyConfig();\n\n        if (conf.snapshot_links_per_second < 0)\n            throw new ConfigurationException(\"snapshot_links_per_second must be >= 0\");\n\n        if (conf.max_value_size.toMebibytes() == 0)\n            throw new ConfigurationException(\"max_value_size must be positive\", false);\n        else if (conf.max_value_size.toMebibytes() >= 2048)\n            throw new ConfigurationException(\"max_value_size must be smaller than 2048, but was \"\n                                             + conf.max_value_size.toString(), false);\n\n        switch (conf.disk_optimization_strategy)\n        {\n            case ssd:\n                diskOptimizationStrategy = new SsdDiskOptimizationStrategy(conf.disk_optimization_page_cross_chance);\n                break;\n            case spinning:\n                diskOptimizationStrategy = new SpinningDiskOptimizationStrategy();\n                break;\n        }\n\n        if (conf.compressed_read_ahead_buffer_size.toKibibytes() > 0 && conf.compressed_read_ahead_buffer_size.toKibibytes() < 256)\n            throw new ConfigurationException(\"compressed_read_ahead_buffer_size must be at least 256KiB (set to 0 to disable), but was \" + conf.compressed_read_ahead_buffer_size, false);\n\n        if (conf.server_encryption_options != null)","sourceCodeStart":1155,"sourceCodeEnd":1191,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L1155-L1191","documentation":"max_value_size bounds the size of a single column value that Cassandra will accept. DatabaseDescriptor throws this ConfigurationException when the configured value rounds down to 0 MiB, because a zero maximum would reject every write.","triggerScenarios":"cassandra.yaml sets max_value_size_in_bytes (max_value_size) to a value below 1 MiB (or 0) and DatabaseDescriptor.applySimpleConfig runs; note the check is on toMebibytes(), so anything under 1MiB is treated as 0.","commonSituations":"Setting max_value_size_in_bytes to a small byte count like 1024 expecting byte-precision; clearing the value to 0 intending 'unlimited'; template rendering an unset variable as 0.","solutions":["Set max_value_size_in_bytes to at least 1048576 (1 MiB)","Keep it below 2048 MiB to satisfy the companion upper-bound check","Remove the override to use the default (256 MiB)"],"exampleFix":"# before (cassandra.yaml)\nmax_value_size_in_bytes: 512000\n# after\nmax_value_size_in_bytes: 16777216","handlingStrategy":"validation","validationCode":"long valueBytes = conf.max_value_size.toBytes();\nif (valueBytes == 0 || valueBytes < 1024L * 1024L) throw new IllegalArgumentException(\"max_value_size must be >= 1 MiB\");","typeGuard":null,"tryCatchPattern":"try { DatabaseDescriptor.applyConfig(conf); } catch (ConfigurationException e) { if (e.getMessage().contains(\"max_value_size must be positive\")) { /* raise the value */ } }","preventionTips":["Remember the check is in whole MiB — set at least 1048576 bytes","Never set max_value_size to 0; there is no 'unlimited' via zero","Keep values within [1 MiB, 2048 MiB) to satisfy both bound checks"],"tags":["cassandra","configuration","limits"],"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"}