openai/codex · error · anyhow::Error

{api} sandbox dir failed: {res}

Error message

{api} sandbox dir failed: {res}

What it means

Error "{api} sandbox dir failed: {res}" thrown in openai/codex.

Source

Thrown at codex-rs/windows-sandbox-rs/src/bin/setup_main/win.rs:405

            ),
            None => {
                let path_w = to_wide(dir.as_os_str());
                (
                    SetNamedSecurityInfoW(
                        path_w.as_ptr() as *mut u16,
                        SE_FILE_OBJECT,
                        DACL_SECURITY_INFORMATION,
                        std::ptr::null_mut(),
                        std::ptr::null_mut(),
                        new_dacl,
                        std::ptr::null_mut(),
                    ),
                    "SetNamedSecurityInfoW",
                )
            }
        };
        if res != 0 {
            return Err(anyhow::anyhow!("{api} sandbox dir failed: {res}"));
        }
        if !new_dacl.is_null() {
            LocalFree(new_dacl as HLOCAL);
        }
        for sid in sids {
            if !sid.is_null() {
                LocalFree(sid as HLOCAL);
            }
        }
    }
    Ok(())
}

pub fn main() -> Result<()> {
    let ret = real_main();
    if let Err(e) = &ret {
        // Best-effort: log unexpected top-level errors.
        if let Ok(codex_home) = std::env::var("CODEX_HOME") {

View on GitHub (pinned to 339751715c)

When it happens

Trigger: Thrown at codex-rs/windows-sandbox-rs/src/bin/setup_main/win.rs:405 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/2d31d10f4da5a255. Report an issue: GitHub.