{"record":{"id":"bae4cb28b3a13cb2","repo":"windmill-labs/windmill","slug":"cannot-take-stdout-from-uv-install-proccess","errorCode":null,"errorMessage":"Cannot take stdout from uv_install_proccess","messagePattern":"Cannot take stdout from uv_install_proccess","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/windmill-worker/src/python_executor.rs","lineNumber":3002,"sourceCode":"                        ),\n                        &conn,\n                    )\n                    .await;\n                    pids.lock().await.get_mut(i).and_then(|e| e.take());\n                    return Err(Error::from(e));\n                }\n            };\n\n            let (mut stderr_buf, mut stdout_buf) = Default::default();\n            let (mut stderr_pipe, mut stdout_pipe) = (\n                uv_install_proccess\n                    .stderr()\n                    .take()\n                    .ok_or(anyhow!(\"Cannot take stderr from uv_install_proccess\"))?,\n                uv_install_proccess\n                    .stdout()\n                    .take()\n                    .ok_or(anyhow!(\"Cannot take stdout from uv_install_proccess\"))?\n            );\n            let (stderr_future, stdout_future) = (\n                stderr_pipe.read_to_string(&mut stderr_buf),\n                stdout_pipe.read_to_string(&mut stdout_buf)\n            );\n\n            if let Some(pid) = pids.lock().await.get_mut(i) {\n                *pid = uv_install_proccess.id();\n                #[cfg(unix)]\n                if let Err(e) = uv_install_proccess\n                  .id()\n                  .ok_or(Error::InternalErr(format!(\n                    \"failed to get PID for python installation process: {}\",\n                    &req\n                  )))\n                  .and_then(|pid| write_file(\n                      &format!(\"/proc/{pid}\"),\n                      \"oom_score_adj\",","sourceCodeStart":2984,"sourceCodeEnd":3020,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/windmill-worker/src/python_executor.rs#L2984-L3020","documentation":"The stdout counterpart of the stderr failure: after spawning `uv pip install`, the code calls .stdout().take() on the child to get the piped stdout handle for async draining. take() returns None when stdout was not spawned as piped or was already taken, and the code raises \"Cannot take stdout from uv_install_proccess\".","triggerScenarios":"The uv install child was spawned without Stdio::piped() for stdout, or another code path already called .stdout().take() on the same Child before this line runs.","commonSituations":"Executor code changes that dropped piped stdout; double-consumption of the child's stdout (e.g. a retry path reusing the same Child); a custom uv wrapper that changes how the process is spawned; Windmill version regressions.","solutions":["Ensure the uv Command sets .stdout(Stdio::piped()) (and .stderr(Stdio::piped())) at spawn time.","Verify the pipe handles are taken exactly once per child; don't reuse the Child across install attempts.","If uv is wrapped or the executor was patched, restore the original spawn options.","Run a known-good Windmill build to confirm it's a local modification, then fix or report the regression."],"exampleFix":"// before\nlet mut uv_install_proccess = Command::new(\"uv\").args([...]).spawn()?;\n// after\nuse std::process::Stdio;\nlet mut uv_install_proccess = Command::new(\"uv\")\n    .args([...])\n    .stdout(Stdio::piped())\n    .stderr(Stdio::piped())\n    .spawn()?;","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"match child.stdout.take() {\n  Some(p) => p,\n  None => return Err(anyhow!(\"uv spawn must set stdout(Stdio::piped()); check executor Command construction\")),\n}","preventionTips":["Configure both stdout and stderr as piped at spawn time, never later","Treat the Child as single-use: one take per pipe, respawn for retries","Regression-test the subprocess spawn path whenever the executor changes"],"tags":["python","subprocess","uv","stdio"],"backgroundTag":"missing-piped-stdio","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}