{"record":{"id":"b3f4633e18f797fd","repo":"pola-rs/polars","slug":"invalid-value-for-name-x-options","errorCode":null,"errorMessage":"invalid value for {name}: {x}","messagePattern":"invalid value for (.+?): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-io/src/cloud/options.rs","lineNumber":212,"sourceCode":"                    )),\n                    max_backoff: Duration::from_millis(parse_env_var(\n                        5 * 1000,\n                        \"POLARS_CLOUD_RETRY_MAX_BACKOFF_MS\",\n                    )),\n                    base: parse_env_var(2., \"POLARS_CLOUD_RETRY_BASE_MULTIPLIER\"),\n                },\n                max_retries: parse_env_var(8, \"POLARS_CLOUD_MAX_RETRIES\"),\n                retry_timeout: Duration::from_millis(parse_env_var(\n                    30 * 1000,\n                    \"POLARS_CLOUD_RETRY_TIMEOUT_MS\",\n                )),\n            });\n\n        fn parse_env_var<T: FromStr>(default: T, name: &'static str) -> T {\n            std::env::var(name).map_or(default, |x| {\n                x.parse::<T>()\n                    .ok()\n                    .unwrap_or_else(|| panic!(\"invalid value for {name}: {x}\"))\n            })\n        }\n    }\n}\n\n/// Rate-limit config publicly exposed through storage_options.\n#[derive(Clone, Copy, Default, Debug, PartialEq, Hash, Eq)]\n#[cfg_attr(feature = \"serde\", derive(Serialize, Deserialize))]\n#[cfg_attr(feature = \"dsl-schema\", derive(schemars::JsonSchema))]\npub struct CloudDirectionalRateLimitConfig {\n    pub init_rate: Option<u64>,\n    pub floor_rate: Option<u64>,\n    pub ceiling_rate: Option<u64>,\n}\n\n#[derive(Clone, Copy, Default, Debug, PartialEq, Hash, Eq)]\n#[cfg_attr(feature = \"serde\", derive(Serialize, Deserialize))]\n#[cfg_attr(feature = \"dsl-schema\", derive(schemars::JsonSchema))]","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/crates/polars-io/src/cloud/options.rs#L194-L230","documentation":"parse_env_var in cloud/options.rs parses retry/backoff-related env vars consumed when building object_store's BackoffConfig/RetryConfig, panicking with 'invalid value for {name}: {x}' when the value cannot be parsed into the target type. This runs while constructing cloud storage options for S3/GCS/Azure clients.","triggerScenarios":"Setting a retry/backoff env var (timeouts, retry counts, backoff durations) to a value that fails FromStr — e.g. '5s' where a u64 is expected, 'true' where a number is expected, or empty strings.","commonSituations":"Mixing up duration conventions (seconds vs milliseconds vs Duration strings) between object_store and Polars; CI variables exported empty when a secret/parameter is missing; upgrading Polars and reusing old variable names with different types.","solutions":["Correct the variable to the plain numeric format expected (the panic message names the variable).","Unset it so the object_store default retry/backoff configuration applies.","Cross-check against object_store::RetryConfig documentation for valid value shapes.","Ensure upstream CI steps do not export empty strings; use conditional export only when a value exists."],"exampleFix":"// before\nexport POLARS_RETRY_TIMEOUT=30s\n// after\nexport POLARS_RETRY_TIMEOUT=30","handlingStrategy":"validation","validationCode":"// Validate retry-related env vars before building storage options\nfn check_retry_env(name: &str) {\n    if let Ok(v) = std::env::var(name) {\n        if v.trim().parse::<u64>().is_err() {\n            panic!(\"{name} must be a plain number, got {v:?}\");\n        }\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use plain numbers for retry counts/timeouts, not Duration strings like '30s'.","Ensure CI exports nothing (not empty strings) when optional values are missing.","After Polars upgrades, re-check that variable names/types still match."],"tags":["rust","env-var","configuration","retry","cloud-io"],"backgroundTag":"invalid-env-var-value","analyzedSha":"fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e","analyzedAt":"2026-09-18T22:14:11.667Z","contentChangedAt":"2026-09-18T22:14:11.667Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}