{"record":{"id":"16830b0053cad8b9","repo":"pola-rs/polars","slug":"invalid-value-for-polars-cloud-footer-read-size-s","errorCode":null,"errorMessage":"invalid value for POLARS_CLOUD_FOOTER_READ_SIZE: {s}","messagePattern":"invalid value for POLARS_CLOUD_FOOTER_READ_SIZE: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-io/src/configs.rs","lineNumber":97,"sourceCode":"        }\n\n        v\n    });\n}\n\n/// Tail size to speculatively fetch when reading file metadata from a cloud source. Sized\n/// generously as the cost of overfetching is low (extra KB) vs the cost of underfetching\n/// (extra round-trip).\npub const DEFAULT_CLOUD_FOOTER_READ_SIZE: usize = 256 * 1024;\n\n// Not cached - lookup cost is low compared to I/O, allows for testing.\npub fn cloud_footer_read_size() -> usize {\n    let Ok(s) = std::env::var(\"POLARS_CLOUD_FOOTER_READ_SIZE\") else {\n        return DEFAULT_CLOUD_FOOTER_READ_SIZE;\n    };\n\n    s.parse::<usize>()\n        .unwrap_or_else(|_| panic!(\"invalid value for POLARS_CLOUD_FOOTER_READ_SIZE: {s}\"))\n}\n","sourceCodeStart":79,"sourceCodeEnd":99,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/crates/polars-io/src/configs.rs#L79-L99","documentation":"This panic fires when POLARS_CLOUD_FOOTER_READ_SIZE is set to a value that cannot be parsed as usize. The variable overrides how many bytes are read when fetching the footer of a remote Parquet file; cloud_footer_read_size parses it and panics on failure. If the variable is unset, a built-in default is returned instead, so only present-but-invalid values abort.","triggerScenarios":"export POLARS_CLOUD_FOOTER_READ_SIZE=0 is accepted by usize parse (note: only parse failures panic), so the panic specifically comes from non-numeric strings like 'abc', '1MB', '-1024' (minus sign fails usize), or empty strings; triggered via fetch_footer_bytes or read_parquet_metadata_bytes on remote Parquet reads.","commonSituations":"Tuning remote Parquet metadata reads for very large footers and using unit suffixes; typos; values copied from a different Polars variable with different formatting rules.","solutions":["Set POLARS_CLOUD_FOOTER_READ_SIZE to a plain non-negative integer of bytes (e.g. 5242880) or unset it for the default","Remove unit suffixes, decimals, and signs","If reading very large Parquet footers, increase the numeric value rather than reformatting it"],"exampleFix":"// before\nexport POLARS_CLOUD_FOOTER_READ_SIZE=5MB\n// after\nexport POLARS_CLOUD_FOOTER_READ_SIZE=5242880","handlingStrategy":"validation","validationCode":"const v = process.env.POLARS_CLOUD_FOOTER_READ_SIZE;\nif (v !== undefined && !/^[0-9]+$/.test(v.trim())) throw new Error(`POLARS_CLOUD_FOOTER_READ_SIZE must be a non-negative integer of bytes, got: ${v}`);","typeGuard":"function isValidFooterReadSize(v) { return typeof v === 'string' && /^\\d+$/.test(v.trim()); }","tryCatchPattern":"// sanitize before launch; usize parse rejects signs, units, decimals\nconst raw = process.env.POLARS_CLOUD_FOOTER_READ_SIZE;\nif (raw && !/^\\d+$/.test(raw.trim())) { console.error('POLARS_CLOUD_FOOTER_READ_SIZE must be plain bytes'); process.exit(2); }","preventionTips":["Use plain byte integers only","Unset the variable to use the default footer read size","Do not copy formats from other tools that accept size suffixes","Check remote Parquet reads (fetch_footer_bytes) when debugging"],"tags":["env-var","configuration","panic","parquet"],"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"}