{"record":{"id":"1981db1689d21287","repo":"cube-js/cube","slug":"wrong-configuration-for-environment-variable-1981db","errorCode":null,"errorMessage":"wrong configuration for environment variable '{}' with '{}' value: greater then max size {}","messagePattern":"wrong configuration for environment variable '(.+?)' with '(.+?)' value: greater then max size (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"rust/cubestore/cubestore/src/config/mod.rs","lineNumber":1466,"sourceCode":"{\n    let v = match env::var(name).ok() {\n        None => {\n            return default;\n        }\n        Some(v) => v,\n    };\n\n    let n = match v.parse::<T>() {\n        Ok(n) => n,\n        Err(e) => panic!(\n            \"could not parse environment variable '{}' with '{}' value: {}\",\n            name, v, e\n        ),\n    };\n\n    if let Some(max) = max {\n        if n > max {\n            panic!(\n                \"wrong configuration for environment variable '{}' with '{}' value: greater then max size {}\",\n                name, v,\n                max\n            )\n        }\n    };\n\n    if let Some(min) = min {\n        if n < min {\n            panic!(\n                \"wrong configuration for environment variable '{}' with '{}' value: lower then min size {}\",\n                name, v,\n                min\n            )\n        }\n    };\n\n    n","sourceCodeStart":1448,"sourceCodeEnd":1484,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/rust/cubestore/cubestore/src/config/mod.rs#L1448-L1484","documentation":"After successfully parsing a numeric env var, the helper checks it against an optional configured maximum and panics if the value exceeds it. The variable parsed fine, but its value is above the allowed ceiling for that setting.","triggerScenarios":"Setting a numeric Cube Store env var to a value larger than the configured `max` bound for that option — e.g. a thread-pool size or queue length above the supported maximum.","commonSituations":"Aggressive tuning attempts (very high concurrency values); copying limits from a machine with more resources; values valid in older versions whose max has since been tightened.","solutions":["Lower the variable's value to at or below the maximum shown in the message.","Consult the docs for that variable's supported range and pick a sane value within it.","If you genuinely need a larger value, upgrade to a Cube Store version whose max bound supports it."],"exampleFix":"// before\nCUBEJS_DB_EXPORT_BUCKET_MAX_ROWS=100000000\n\n// after (max is 50,000,000)\nCUBEJS_DB_EXPORT_BUCKET_MAX_ROWS=50000000","handlingStrategy":"validation","validationCode":"let v: usize = std::env::var(\"CUBEJS_WORKER_THREADS\").unwrap_or_default().parse().unwrap_or(0);\nconst MAX: usize = 64;\nif v > MAX {\n    panic!(\"CUBEJS_WORKER_THREADS={} exceeds max {}\", v, MAX);\n}","typeGuard":"fn within_max(v: u64, max: u64) -> bool {\n    v <= max\n}","tryCatchPattern":"// Validate bounds before startup since the panic is fatal.\nif let Ok(raw) = std::env::var(name) {\n    let v: u64 = raw.parse().map_err(|e| anyhow!(\"bad int for {}: {}\", name, e))?;\n    ensure!(v <= max, \"{}={} exceeds max {}\", name, v, max);\n}","preventionTips":["Read the documented maximum for each numeric env var before tuning.","Clamp generated values with `.min(max)` in config automation.","Re-validate values when upgrading — max bounds can change between versions."],"tags":["configuration","environment-variables","validation","startup"],"backgroundTag":"invalid-env-var-value","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}