{"record":{"id":"2d31d10f4da5a255","repo":"openai/codex","slug":"api-sandbox-dir-failed-res","errorCode":null,"errorMessage":"{api} sandbox dir failed: {res}","messagePattern":"(.+?) sandbox dir failed: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/windows-sandbox-rs/src/bin/setup_main/win.rs","lineNumber":405,"sourceCode":"            ),\n            None => {\n                let path_w = to_wide(dir.as_os_str());\n                (\n                    SetNamedSecurityInfoW(\n                        path_w.as_ptr() as *mut u16,\n                        SE_FILE_OBJECT,\n                        DACL_SECURITY_INFORMATION,\n                        std::ptr::null_mut(),\n                        std::ptr::null_mut(),\n                        new_dacl,\n                        std::ptr::null_mut(),\n                    ),\n                    \"SetNamedSecurityInfoW\",\n                )\n            }\n        };\n        if res != 0 {\n            return Err(anyhow::anyhow!(\"{api} sandbox dir failed: {res}\"));\n        }\n        if !new_dacl.is_null() {\n            LocalFree(new_dacl as HLOCAL);\n        }\n        for sid in sids {\n            if !sid.is_null() {\n                LocalFree(sid as HLOCAL);\n            }\n        }\n    }\n    Ok(())\n}\n\npub fn main() -> Result<()> {\n    let ret = real_main();\n    if let Err(e) = &ret {\n        // Best-effort: log unexpected top-level errors.\n        if let Ok(codex_home) = std::env::var(\"CODEX_HOME\") {","sourceCodeStart":387,"sourceCodeEnd":423,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/windows-sandbox-rs/src/bin/setup_main/win.rs#L387-L423","documentation":"Error \"{api} sandbox dir failed: {res}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/windows-sandbox-rs/src/bin/setup_main/win.rs:405 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"}