openai/codex · error
LookupPrivilegeValueW failed: {}
Error message
LookupPrivilegeValueW failed: {} What it means
Error "LookupPrivilegeValueW failed: {}" thrown in openai/codex.
Source
Thrown at codex-rs/windows-sandbox-rs/src/token.rs:326
if CopySid(
sid_len,
user_sid_bytes.as_mut_ptr() as *mut c_void,
token_user.User.Sid,
) == 0
{
return Err(anyhow!("CopySid(TokenUser) failed: {}", GetLastError()));
}
Ok(user_sid_bytes)
}
unsafe fn enable_single_privilege(h_token: HANDLE, name: &str) -> Result<()> {
let mut luid = LUID {
LowPart: 0,
HighPart: 0,
};
let ok = LookupPrivilegeValueW(std::ptr::null(), to_wide(name).as_ptr(), &mut luid);
if ok == 0 {
return Err(anyhow!("LookupPrivilegeValueW failed: {}", GetLastError()));
}
let mut tp: TOKEN_PRIVILEGES = std::mem::zeroed();
tp.PrivilegeCount = 1;
tp.Privileges[0].Luid = luid;
tp.Privileges[0].Attributes = 0x00000002; // SE_PRIVILEGE_ENABLED
let ok2 = AdjustTokenPrivileges(
h_token,
0,
&tp,
0,
std::ptr::null_mut(),
std::ptr::null_mut(),
);
if ok2 == 0 {
return Err(anyhow!("AdjustTokenPrivileges failed: {}", GetLastError()));
}
let err = GetLastError();
if err != 0 {View on GitHub (pinned to 339751715c)
When it happens
Trigger: Thrown at codex-rs/windows-sandbox-rs/src/token.rs:326 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/4af01b6c02b3b298.
Report an issue: GitHub.