{"record":{"id":"704fa8ce66714832","repo":"openai/codex","slug":"helperdpapiprotectfailed","errorCode":"HelperDpapiProtectFailed","errorMessage":"dpapi protect failed for offline user: {err}","messagePattern":"dpapi protect failed for offline user: (.+?)","errorType":"error_code","errorClass":"SetupFailure","httpStatus":null,"severity":"error","filePath":"codex-rs/windows-sandbox-rs/src/bin/setup_main/win/sandbox_users.rs","lineNumber":423,"sourceCode":"fn write_secrets(\n    codex_home: &Path,\n    offline_user: &str,\n    offline_pwd: &str,\n    online_user: &str,\n    online_pwd: &str,\n) -> Result<()> {\n    let secrets_dir = sandbox_secrets_dir(codex_home);\n    std::fs::create_dir_all(&secrets_dir).map_err(|err| {\n        anyhow::Error::new(SetupFailure::new(\n            SetupErrorCode::HelperUsersFileWriteFailed,\n            format!(\n                \"failed to create secrets dir {}: {err}\",\n                secrets_dir.display()\n            ),\n        ))\n    })?;\n    let offline_blob = dpapi_protect(offline_pwd.as_bytes()).map_err(|err| {\n        anyhow::Error::new(SetupFailure::new(\n            SetupErrorCode::HelperDpapiProtectFailed,\n            format!(\"dpapi protect failed for offline user: {err}\"),\n        ))\n    })?;\n    let online_blob = dpapi_protect(online_pwd.as_bytes()).map_err(|err| {\n        anyhow::Error::new(SetupFailure::new(\n            SetupErrorCode::HelperDpapiProtectFailed,\n            format!(\"dpapi protect failed for online user: {err}\"),\n        ))\n    })?;\n    let users = SandboxUsersFile {\n        version: SETUP_VERSION,\n        offline: SandboxUserRecord {\n            username: offline_user.to_string(),\n            password: BASE64.encode(offline_blob),\n        },\n        online: SandboxUserRecord {\n            username: online_user.to_string(),","sourceCodeStart":405,"sourceCodeEnd":441,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/windows-sandbox-rs/src/bin/setup_main/win/sandbox_users.rs#L405-L441","documentation":"Error \"dpapi protect failed for offline user: {err}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/windows-sandbox-rs/src/bin/setup_main/win/sandbox_users.rs:423 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"}