openai/codex · error · io::Error

AlreadyExists

AlreadyExists

Error message

failed to allocate proxy routing temp dir under {}

What it means

Error "failed to allocate proxy routing temp dir under {}" thrown in openai/codex.

Source

Thrown at codex-rs/linux-sandbox/src/proxy_routing.rs:325

}

fn create_proxy_socket_dir() -> io::Result<PathBuf> {
    let temp_dir = proxy_socket_parent_dir();
    let pid = std::process::id();
    let uid = unsafe { libc::geteuid() };
    for attempt in 0..128 {
        let candidate = temp_dir.join(format!("{PROXY_SOCKET_DIR_PREFIX}{pid}-{uid}-{attempt}"));
        // The bridge UDS paths live under a shared temp root, so the per-run
        // directory should not be traversable by other processes.
        let mut dir_builder = DirBuilder::new();
        dir_builder.mode(0o700);
        match dir_builder.create(&candidate) {
            Ok(()) => return Ok(candidate),
            Err(err) if err.kind() == io::ErrorKind::AlreadyExists => continue,
            Err(err) => return Err(err),
        }
    }
    Err(io::Error::new(
        io::ErrorKind::AlreadyExists,
        format!(
            "failed to allocate proxy routing temp dir under {}",
            temp_dir.display()
        ),
    ))
}

fn proxy_socket_parent_dir() -> PathBuf {
    if let Some(codex_home) = std::env::var_os("CODEX_HOME") {
        let candidate = PathBuf::from(codex_home).join("tmp");
        if proxy_socket_paths_fit(candidate.as_path())
            && ensure_private_proxy_socket_parent_dir(candidate.as_path()).is_ok()
        {
            return candidate;
        }
    }
    let temp_dir = std::env::temp_dir();

View on GitHub (pinned to 339751715c)

When it happens

Trigger: Thrown at codex-rs/linux-sandbox/src/proxy_routing.rs:325 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of openai/codex@339751715c (2026-08-25). Data as JSON: /api/errors/a4378886a3768081. Report an issue: GitHub.