pola-rs/polars · error

failed to open spill file {:?}: {e}

Error message

failed to open spill file {:?}: {e}

What it means

Panic in the OOC unspill path when std::fs::File::open fails on a previously written spill file that has since been deleted or made unreadable (cleaner race, cleanup by another process, permissions). The message includes the path and io error.

Source

Thrown at crates/polars-ooc/src/spill_frame.rs:76

                            "failed to create spill file '{}': {e}",
                            spill_file.path().display()
                        );
                        spill_file.creation_aborted();
                        panic!("{msg}")
                    },
                }
            })
            .await
            .unwrap();
        Arc::new(file)
    }

    async fn unspill(location: &Self::Spilled) -> Self {
        let path = location.path().to_owned();
        ASYNC
            .spawn_blocking(move || {
                let file = std::fs::File::open(&path).unwrap_or_else(|e| {
                    panic!("failed to open spill file {:?}: {e}", path.display())
                });
                IpcStreamReader::new(file).finish().unwrap_or_else(|e| {
                    panic!("failed to read spill file {:?}: {e}", path.display())
                })
            })
            .await
            .unwrap()
    }
}

#[derive(Clone)]
pub struct SpillFrame {
    token: SpillToken<DataFrame>,
    height: usize,
}

impl AsRef<SpillToken<DataFrame>> for SpillFrame {
    fn as_ref(&self) -> &SpillToken<DataFrame> {

View on GitHub (pinned to 68506541d2)

Solutions

  1. The spill file could not be opened; check that it was not deleted externally and permissions allow reading.
  2. Investigate the underlying OS error included in the message (path and error).
Defensive patterns

Strategy: try-catch

When it happens

Trigger: This panic/expect fires when execution reaches an unguarded state described by: "failed to open spill file {:?}: {e}". 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.

Common situations: Encountered when input data or configuration does not meet the preconditions of the throwing code path ("failed to open spill file {:?}: {e}"). 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.


AI-assisted analysis of pola-rs/polars@68506541d2 (2026-08-19). Data as JSON: /api/errors/0268b5f9406872a4. Report an issue: GitHub.