{"record":{"id":"f57a3468c76a3403","repo":"pola-rs/polars","slug":"failed-to-create-spill-directory-e-path-pro","errorCode":null,"errorMessage":"failed to create spill directory: {e} (path = {process_dir:?})","messagePattern":"failed to create spill directory: (.+?) \\(path = (.+?)\\)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-ooc/src/spill_file.rs","lineNumber":20,"sourceCode":"use std::sync::LazyLock;\nuse std::sync::mpsc::{Receiver, Sender, channel};\n\nuse polars_io::create_dir_owner_only;\n\nuse crate::BYTES_SPILLED_TO_DISK;\n\n/// On-disk layout:\n///\n/// ```text\n/// <spill_dir>/\n///   <pid>/                     <- process directory (one per OS process)\n///     spill-<ctx>-<uuid>.ipc   <- individual spill file (unique per spill)\n/// ```\nstatic SPILL_DIR: LazyLock<PathBuf> = LazyLock::new(|| {\n    let spill_dir = polars_config::config().ooc_spill_dir();\n    let process_dir = spill_dir.join(std::process::id().to_string());\n    create_dir_owner_only(&process_dir).unwrap_or_else(|e| {\n        panic!(\"failed to create spill directory: {e} (path = {process_dir:?})\")\n    });\n    process_dir\n});\n\npub struct SpillFile {\n    path: PathBuf,\n    size: u64,\n}\n\nimpl SpillFile {\n    pub fn new(context_id: &str, ext: &str, size: u64) -> Self {\n        let uuid = uuid::Uuid::now_v7();\n        Self {\n            path: SPILL_DIR\n                .join(format!(\n                    \"spill-{context_id}-{uuid}.{ext}\",\n                    uuid = uuid.as_hyphenated()\n                ))","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/pola-rs/polars/blob/9b5d73fd00236295624374b075d16b1fe6ec6df9/crates/polars-ooc/src/spill_file.rs#L2-L38","documentation":"Panic while initializing the out-of-core spill directory: create_dir_owner_only failed to create the per-process directory under the configured ooc spill dir (permissions, disk full, or a conflicting path). The message includes the io error and path; check/clean the spill directory or change the config.","triggerScenarios":"This panic/expect fires when execution reaches an unguarded state described by: \"failed to create spill directory: {e} (path = {process_dir:?})\". Typical triggers: unsupported dtype or feature-gated code path reached at runtime, invalid user input or environment variable value, calling API methods in the wrong order or on mismatched types, or data (lengths, offsets, ranges) violating the function's preconditions.","commonSituations":"Encountered when input data or configuration does not meet the preconditions of the throwing code path (\"failed to create spill directory: {e} (path = {process_dir:?})\"). Common cases: missing Cargo feature flags, mismatched dtypes/lengths between arrays or series, out-of-range temporal values, malformed environment variables, or operations on unsupported/complex nested types.","solutions":["Ensure the spill directory parent exists and is writable; check permissions and available disk space.","Set the spill/temp directory to a valid writable path via the polars configuration."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b5d73fd00236295624374b075d16b1fe6ec6df9","analyzedAt":"2026-08-19T12:15:06.350Z","contentChangedAt":"2026-08-19T12:15:06.350Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}