{"record":{"id":"6dc9aa270b1a63e9","repo":"openai/codex","slug":"openmutexw-failed-err","errorCode":null,"errorMessage":"OpenMutexW failed: {err}","messagePattern":"OpenMutexW failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"codex-rs/windows-sandbox-rs/src/bin/command_runner/win.rs","lineNumber":205,"sourceCode":"    };\n    if msg.version != IPC_PROTOCOL_VERSION {\n        anyhow::bail!(\"runner: unsupported protocol version {}\", msg.version);\n    }\n    match msg.message {\n        Message::SpawnRequest { payload } => Ok(*payload),\n        other => anyhow::bail!(\"runner: expected spawn_request, got {other:?}\"),\n    }\n}\n\nfn read_acl_mutex_exists() -> Result<bool> {\n    let name = to_wide(OsStr::new(READ_ACL_MUTEX_NAME));\n    let handle = unsafe { OpenMutexW(MUTEX_ALL_ACCESS, 0, name.as_ptr()) };\n    if handle == 0 {\n        let err = unsafe { GetLastError() };\n        if err == ERROR_FILE_NOT_FOUND {\n            return Ok(false);\n        }\n        return Err(anyhow::anyhow!(\"OpenMutexW failed: {err}\"));\n    }\n    unsafe {\n        CloseHandle(handle);\n    }\n    Ok(true)\n}\n\n/// Pick an effective CWD, using a junction if the ACL helper is active.\nfn effective_cwd(req_cwd: &Path, log_dir: Option<&Path>) -> PathBuf {\n    let use_junction = match read_acl_mutex_exists() {\n        Ok(exists) => exists,\n        Err(err) => {\n            log_note(\n                &format!(\n                    \"junction: failed to probe ACL mutex state: {err}; defaulting to junction cwd\"\n                ),\n                log_dir,\n            );","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/windows-sandbox-rs/src/bin/command_runner/win.rs#L187-L223","documentation":"Error \"OpenMutexW failed: {err}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/windows-sandbox-rs/src/bin/command_runner/win.rs:205 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"}