{"record":{"id":"f1ca570a3727f2f9","repo":"openai/codex","slug":"helperusersgroupcreatefailed","errorCode":"HelperUsersGroupCreateFailed","errorMessage":"failed to create local group {name}, code {status}","messagePattern":"failed to create local group (.+?), code (.+?)","errorType":"error_code","errorClass":"SetupFailure","httpStatus":null,"severity":"error","filePath":"codex-rs/windows-sandbox-rs/src/bin/setup_main/win/sandbox_users.rs","lineNumber":188,"sourceCode":"    let comment_w = to_wide(OsStr::new(comment));\n    unsafe {\n        let info = LOCALGROUP_INFO_1 {\n            lgrpi1_name: name_w.as_ptr() as *mut u16,\n            lgrpi1_comment: comment_w.as_ptr() as *mut u16,\n        };\n        let mut parm_err: u32 = 0;\n        let status = NetLocalGroupAdd(\n            std::ptr::null(),\n            1,\n            &info as *const _ as *mut u8,\n            &mut parm_err as *mut _,\n        );\n        if status != NERR_Success && status != ERROR_ALIAS_EXISTS && status != NERR_GROUP_EXISTS {\n            super::log_line(\n                log,\n                &format!(\"NetLocalGroupAdd failed for {name} code {status} parm_err={parm_err}\"),\n            )?;\n            return Err(anyhow::Error::new(SetupFailure::new(\n                SetupErrorCode::HelperUsersGroupCreateFailed,\n                format!(\"failed to create local group {name}, code {status}\"),\n            )));\n        }\n    }\n    Ok(())\n}\n\npub fn ensure_local_group_member(group_name: &str, member_name: &str) -> Result<()> {\n    // If the member is already in the group, NetLocalGroupAddMembers may\n    // return an error code. We don't care.\n    let group_w = to_wide(OsStr::new(group_name));\n    let member_w = to_wide(OsStr::new(member_name));\n    unsafe {\n        let member = LOCALGROUP_MEMBERS_INFO_3 {\n            lgrmi3_domainandname: member_w.as_ptr() as *mut u16,\n        };\n        let _ = NetLocalGroupAddMembers(","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/windows-sandbox-rs/src/bin/setup_main/win/sandbox_users.rs#L170-L206","documentation":"Error \"failed to create local group {name}, code {status}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/windows-sandbox-rs/src/bin/setup_main/win/sandbox_users.rs:188 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"}