{"record":{"id":"7349325d196fa3ab","repo":"pola-rs/polars","slug":"invalid-value-for-polars-http-connect-timeout-seconds-x","errorCode":null,"errorMessage":"invalid value for POLARS_HTTP_CONNECT_TIMEOUT_SECONDS: {x}","messagePattern":"invalid value for POLARS_HTTP_CONNECT_TIMEOUT_SECONDS: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-io/src/cloud/options.rs","lineNumber":330,"sourceCode":"pub static USER_AGENT: &str = concat!(\"polars\", \"/\", env!(\"CARGO_PKG_VERSION\"),);\n\n#[cfg(any(feature = \"aws\", feature = \"gcp\", feature = \"azure\", feature = \"http\"))]\npub(super) fn get_client_options() -> ClientOptions {\n    use std::num::NonZeroU64;\n\n    use reqwest::header::HeaderValue;\n\n    ClientOptions::new()\n        // Disables the time limit for downloading the response body.\n        .with_timeout_disabled()\n        // Set the time limit for establishing the connection.\n        .with_connect_timeout(std::time::Duration::from_secs(\n            std::env::var(\"POLARS_HTTP_CONNECT_TIMEOUT_SECONDS\")\n                .map(|x| {\n                    x.parse::<NonZeroU64>()\n                        .ok()\n                        .unwrap_or_else(|| {\n                            panic!(\"invalid value for POLARS_HTTP_CONNECT_TIMEOUT_SECONDS: {x}\")\n                        })\n                        .get()\n                })\n                .unwrap_or(5 * 60),\n        ))\n        .with_user_agent(HeaderValue::from_static(USER_AGENT))\n        .with_allow_http(true)\n        .with_dns_resolver(Arc::new(\n            CachingResolver::new(DnsResolverConfig::from_env()),\n        ))\n}\n\n#[cfg(feature = \"aws\")]\nfn read_config(\n    builder: &mut AmazonS3Builder,\n    items: &[(&Path, &[(&str, AmazonS3ConfigKey)])],\n) -> Option<()> {\n    use crate::path_utils::resolve_homedir;","sourceCodeStart":312,"sourceCodeEnd":348,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/crates/polars-io/src/cloud/options.rs#L312-L348","documentation":"When building cloud client options (build_aws/build_azure/build_gcp), Polars reads POLARS_HTTP_CONNECT_TIMEOUT_SECONDS as a NonZeroU64 to configure the HTTP connect timeout (default 300 seconds). A set-but-unparseable or zero value triggers this panic during storage client construction.","triggerScenarios":"Setting POLARS_HTTP_CONNECT_TIMEOUT_SECONDS to '5min', '300.0', '0', '', or any non-NonZeroU64 string before scanning/writing to a cloud URL.","commonSituations":"Duration suffixes carried over from reqwest/HTTP-client style configs; zero intended as 'no timeout' (not supported — must be a positive integer); values generated by tools that quote env values.","solutions":["Set the variable to a positive integer number of seconds, e.g. 300.","Unset it to use the default 5-minute connect timeout.","Use the timeout unit explicitly in the variable name — it is SECONDS, so convert durations before export.","If 'no timeout' is desired, use a very large integer rather than 0, since 0 is rejected."],"exampleFix":"// before\nexport POLARS_HTTP_CONNECT_TIMEOUT_SECONDS=5min\n// after\nexport POLARS_HTTP_CONNECT_TIMEOUT_SECONDS=300","handlingStrategy":"validation","validationCode":"const v = process.env.POLARS_HTTP_CONNECT_TIMEOUT_SECONDS;\nif (v !== undefined && (!/^[1-9]\\d*$/.test(v.trim()) || BigInt(v) > 18446744073709551615n)) {\n  throw new Error(`POLARS_HTTP_CONNECT_TIMEOUT_SECONDS must be a positive integer (seconds), got: ${JSON.stringify(v)}`);\n}","typeGuard":"const isValidTimeoutSeconds = (v) => typeof v === 'string' && /^[1-9]\\d*$/.test(v.trim());","tryCatchPattern":null,"preventionTips":["The unit is seconds — convert '5min' to 300 before export.","Zero is rejected; use a large integer or unset the variable for defaults.","Avoid duration formats from other HTTP libraries; this variable takes only integer seconds."],"tags":["rust","env-var","configuration","timeout","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"}