windmill-labs/windmill · info

uv pip install was canceled

Error message

uv pip install was canceled

What it means

While `uv pip install` runs, handle_python_reqs selects between the job's kill_rx channel and a future awaiting the child's stderr/stdout pipes and exit status. If kill_rx fires first (the job was canceled), the code kills the uv process, removes its tracked pid, and returns "uv pip install was canceled". It is a deliberate cooperative-cancellation message, not an install failure.

Source

Thrown at backend/windmill-worker/src/python_executor.rs:3041

                {
                  tracing::error!(
                      req = %req,
                      "Failed to create oom_score_adj for python dependency installation process: {e}"
                  );
                }
            } else {
                tracing::error!(
                    workspace_id = %w_id,
                    "Index out of range for uv pids",
                );
            }

            tokio::select! {
                // Canceled
                _ = kill_rx.recv() => {
                    Box::into_pin(uv_install_proccess.kill()).await?;
                    pids.lock().await.get_mut(i).and_then(|e| e.take());
                    return Err(Error::from(anyhow::anyhow!("uv pip install was canceled")));
                },
                (_, _, exitstatus) = async {
                    // See tokio::process::Child::wait_with_output() for more context
                    // Sometimes uv_install_proccess.wait() is not exiting if stderr is not awaited first
                    (stderr_future.await, stdout_future.await, Box::into_pin(uv_install_proccess.wait()).await)
                } => match exitstatus {
                    Ok(status) => if !status.success() {
                        #[cfg(unix)]
                        let code = status.signal();
                        #[cfg(not(unix))]
                        let code = status.code();

                        tracing::warn!(
                            workspace_id = %w_id,
                            "uv install {} did not succeed, exit status: {:?}",
                            &req,
                            code
                        );

View on GitHub (pinned to e474e8803c)

Solutions

  1. If the cancel was intentional, just rerun the job — the venv lock and cache make the next install resume/reuse work.
  2. Trim or pin requirements (use a lockfile/wheel cache) so installs finish well inside timeouts.
  3. Raise the step/job timeout if long installs are routinely being killed.
  4. Check for repeated spurious cancellations (worker restarts, flow engine bugs) in worker logs.
Defensive patterns

Strategy: retry

Try / catch

try {
  return await runPythonStep();
} catch (e) {
  if (String(e.message).includes('uv pip install was canceled')) {
    return await runPythonStep(); // partial install resumes from cache
  }
  throw e;
}

Prevention

When it happens

Trigger: A Python dependency installation is canceled while uv is actively running: user stops the job, a flow is canceled mid-step, a per-job timeout expires, or the worker is draining and cancels queued/running installs.

Common situations: Canceling a script whose first run needs a big requirements install; flow timeouts smaller than the install duration; duplicated runs stopped after one succeeds; operator kills a stuck run during dependency resolution.

Related errors


AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03). Data as JSON: /api/errors/4579b59c0f09de76. Report an issue: GitHub.