{"record":{"id":"62c36952e78951c2","repo":"cube-js/cube","slug":"wrong-configuration-for-environment-variable-62c369","errorCode":null,"errorMessage":"wrong configuration for environment variable '{}' with '{}' value: lower then min size {}","messagePattern":"wrong configuration for environment variable '(.+?)' with '(.+?)' value: lower then min size (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rust/cubesql/cubesql/src/config/mod.rs","lineNumber":493,"sourceCode":"        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\n}\n\npub type LoopHandle = JoinHandle<Result<(), CubeError>>;\n","sourceCodeStart":475,"sourceCodeEnd":505,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/rust/cubesql/cubesql/src/config/mod.rs#L475-L505","documentation":"env_parse_duration parses a duration-valued environment variable and, when a minimum bound is supplied, panics if the parsed duration is smaller than that minimum. This prevents configurations that would e.g. poll too frequently or time out instantly.","triggerScenarios":"Setting a duration env variable consumed via env_parse_duration to a value below the configured min (e.g. '0s', '1ms', or a bare small integer) where the call site requires a larger floor.","commonSituations":"Disabling a feature by setting its interval to 0; typos omitting units so '100' is interpreted with a tiny unit; copying tuned prod values into constrained dev environments.","solutions":["Raise the value of the environment variable so it meets the minimum","Check the env_parse_duration call site to learn the exact min bound","Remove the variable to fall back to the default instead of forcing a tiny value"],"exampleFix":"// before\nCUBESQL_META_TRANSPORT_REQUEST_TIMEOUT=0s\n// after\nCUBESQL_META_TRANSPORT_REQUEST_TIMEOUT=30s","handlingStrategy":"validation","validationCode":"fn validate_duration_env_min(name: &str, min_secs: i64) -> Result<(), String> {\n    match std::env::var(name) {\n        Ok(v) => match env_parse_duration_str(&v) {\n            Ok(n) if n >= min_secs => Ok(()),\n            Ok(n) => Err(format!(\"{}={} below min {}s\", name, n, min_secs)),\n            Err(e) => Err(format!(\"{} unparseable: {}\", name, e)),\n        },\n        Err(_) => Ok(()),\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never set interval/timeout env vars to 0 to 'disable' features — remove them instead","Always include explicit units (s/m/h) in duration values","Verify min bounds in the source before choosing small values"],"tags":["rust","configuration","env-var","panic"],"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"}