{"record":{"id":"a4378886a3768081","repo":"openai/codex","slug":"alreadyexists","errorCode":"AlreadyExists","errorMessage":"failed to allocate proxy routing temp dir under {}","messagePattern":"failed to allocate proxy routing temp dir under (.+?)","errorType":"exception","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/linux-sandbox/src/proxy_routing.rs","lineNumber":325,"sourceCode":"}\n\nfn create_proxy_socket_dir() -> io::Result<PathBuf> {\n    let temp_dir = proxy_socket_parent_dir();\n    let pid = std::process::id();\n    let uid = unsafe { libc::geteuid() };\n    for attempt in 0..128 {\n        let candidate = temp_dir.join(format!(\"{PROXY_SOCKET_DIR_PREFIX}{pid}-{uid}-{attempt}\"));\n        // The bridge UDS paths live under a shared temp root, so the per-run\n        // directory should not be traversable by other processes.\n        let mut dir_builder = DirBuilder::new();\n        dir_builder.mode(0o700);\n        match dir_builder.create(&candidate) {\n            Ok(()) => return Ok(candidate),\n            Err(err) if err.kind() == io::ErrorKind::AlreadyExists => continue,\n            Err(err) => return Err(err),\n        }\n    }\n    Err(io::Error::new(\n        io::ErrorKind::AlreadyExists,\n        format!(\n            \"failed to allocate proxy routing temp dir under {}\",\n            temp_dir.display()\n        ),\n    ))\n}\n\nfn proxy_socket_parent_dir() -> PathBuf {\n    if let Some(codex_home) = std::env::var_os(\"CODEX_HOME\") {\n        let candidate = PathBuf::from(codex_home).join(\"tmp\");\n        if proxy_socket_paths_fit(candidate.as_path())\n            && ensure_private_proxy_socket_parent_dir(candidate.as_path()).is_ok()\n        {\n            return candidate;\n        }\n    }\n    let temp_dir = std::env::temp_dir();","sourceCodeStart":307,"sourceCodeEnd":343,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/linux-sandbox/src/proxy_routing.rs#L307-L343","documentation":"Error \"failed to allocate proxy routing temp dir under {}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/linux-sandbox/src/proxy_routing.rs:325 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}