{"record":{"id":"ffbaa4f372428d6a","repo":"openai/codex","slug":"createpipe-stdin-failed","errorCode":null,"errorMessage":"CreatePipe stdin failed: {}","messagePattern":"CreatePipe stdin failed: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/windows-sandbox-rs/src/process.rs","lineNumber":243,"sourceCode":"    h_token: HANDLE,\n    argv: &[String],\n    cwd: &Path,\n    env_map: &HashMap<String, String>,\n    stdin_mode: StdinMode,\n    stderr_mode: StderrMode,\n    console_mode: ConsoleMode,\n    use_private_desktop: bool,\n    logs_base_dir: Option<&Path>,\n) -> Result<PipeSpawnHandles> {\n    let mut in_r: HANDLE = 0;\n    let mut in_w: HANDLE = 0;\n    let mut out_r: HANDLE = 0;\n    let mut out_w: HANDLE = 0;\n    let mut err_r: HANDLE = 0;\n    let mut err_w: HANDLE = 0;\n    unsafe {\n        if CreatePipe(&mut in_r, &mut in_w, ptr::null_mut(), 0) == 0 {\n            return Err(anyhow!(\"CreatePipe stdin failed: {}\", GetLastError()));\n        }\n        if CreatePipe(&mut out_r, &mut out_w, ptr::null_mut(), 0) == 0 {\n            CloseHandle(in_r);\n            CloseHandle(in_w);\n            return Err(anyhow!(\"CreatePipe stdout failed: {}\", GetLastError()));\n        }\n        if matches!(stderr_mode, StderrMode::Separate)\n            && CreatePipe(&mut err_r, &mut err_w, ptr::null_mut(), 0) == 0\n        {\n            CloseHandle(in_r);\n            CloseHandle(in_w);\n            CloseHandle(out_r);\n            CloseHandle(out_w);\n            return Err(anyhow!(\"CreatePipe stderr failed: {}\", GetLastError()));\n        }\n    }\n\n    let stderr_handle = match stderr_mode {","sourceCodeStart":225,"sourceCodeEnd":261,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/windows-sandbox-rs/src/process.rs#L225-L261","documentation":"CreatePipe returned zero while allocating the stdin pipe pair for the sandboxed child, so no input stream could be set up. Commonly caused by resource exhaustion (too many open handles) or invalid security attributes.","triggerScenarios":"Thrown at codex-rs/windows-sandbox-rs/src/process.rs:243 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the GetLastError value in the message for the exact cause","Reduce open handle counts if the process is exhausting resources","Retry pipe creation after a brief delay for transient failures"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}