{"record":{"id":"76ce01cafc8418fb","repo":"openai/codex","slug":"setfileattributesw-failed-for-err-error","errorCode":null,"errorMessage":"SetFileAttributesW failed for {}: {err} ({error})","messagePattern":"SetFileAttributesW failed for (.+?): (.+?) \\((.+?)\\)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/windows-sandbox-rs/src/hide_users.rs","lineNumber":151,"sourceCode":"fn hide_directory(path: &Path) -> anyhow::Result<bool> {\n    let wide = to_wide(path);\n    let attrs = unsafe { GetFileAttributesW(wide.as_ptr()) };\n    if attrs == INVALID_FILE_ATTRIBUTES {\n        let err = unsafe { GetLastError() } as i32;\n        return Err(anyhow!(\n            \"GetFileAttributesW failed for {}: {err} ({error})\",\n            path.display(),\n            error = format_last_error(err)\n        ));\n    }\n    let new_attrs = attrs | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM;\n    if new_attrs == attrs {\n        return Ok(false);\n    }\n    let ok = unsafe { SetFileAttributesW(wide.as_ptr(), new_attrs) };\n    if ok == 0 {\n        let err = unsafe { GetLastError() } as i32;\n        return Err(anyhow!(\n            \"SetFileAttributesW failed for {}: {err} ({error})\",\n            path.display(),\n            error = format_last_error(err)\n        ));\n    }\n    Ok(true)\n}\n","sourceCodeStart":133,"sourceCodeEnd":159,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/windows-sandbox-rs/src/hide_users.rs#L133-L159","documentation":"Error \"SetFileAttributesW failed for {}: {err} ({error})\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/windows-sandbox-rs/src/hide_users.rs:151 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"}