{"record":{"id":"6045b260bbb498ee","repo":"openai/codex","slug":"lookupaccountsidw-preflight-failed-for-sid-str","errorCode":null,"errorMessage":"LookupAccountSidW preflight failed for {sid_str}: {err}","messagePattern":"LookupAccountSidW preflight failed for (.+?): (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/windows-sandbox-rs/src/bin/setup_main/win/sandbox_users.rs","lineNumber":322,"sourceCode":"    let mut use_type: SID_NAME_USE = 0;\n    let ok = unsafe {\n        LookupAccountSidW(\n            std::ptr::null(),\n            psid,\n            std::ptr::null_mut(),\n            &mut name_len,\n            std::ptr::null_mut(),\n            &mut domain_len,\n            &mut use_type,\n        )\n    };\n    if ok == 0 {\n        let err = unsafe { GetLastError() };\n        if err != ERROR_INSUFFICIENT_BUFFER {\n            unsafe {\n                LocalFree(psid as _);\n            }\n            return Err(anyhow::anyhow!(\n                \"LookupAccountSidW preflight failed for {sid_str}: {err}\"\n            ));\n        }\n    }\n    let mut name_buf: Vec<u16> = vec![0u16; name_len as usize];\n    let mut domain_buf: Vec<u16> = vec![0u16; domain_len as usize];\n    let ok = unsafe {\n        LookupAccountSidW(\n            std::ptr::null(),\n            psid,\n            name_buf.as_mut_ptr(),\n            &mut name_len,\n            domain_buf.as_mut_ptr(),\n            &mut domain_len,\n            &mut use_type,\n        )\n    };\n    unsafe {","sourceCodeStart":304,"sourceCodeEnd":340,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/windows-sandbox-rs/src/bin/setup_main/win/sandbox_users.rs#L304-L340","documentation":"Error \"LookupAccountSidW preflight failed for {sid_str}: {err}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/windows-sandbox-rs/src/bin/setup_main/win/sandbox_users.rs:322 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"}