{"record":{"id":"30fac561a81b7429","repo":"openai/codex","slug":"hdiutil-detach-failed-with-status","errorCode":null,"errorMessage":"hdiutil detach failed with {status}","messagePattern":"hdiutil detach failed with (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/cli/src/desktop_app/mac.rs","lineNumber":291,"sourceCode":"\n    let stdout = String::from_utf8_lossy(&output.stdout);\n    parse_hdiutil_attach_mount_point(&stdout)\n        .map(PathBuf::from)\n        .with_context(|| format!(\"failed to parse mount point from hdiutil output:\\n{stdout}\"))\n}\n\nasync fn detach_dmg(mount_point: &Path) -> anyhow::Result<()> {\n    let status = Command::new(\"hdiutil\")\n        .arg(\"detach\")\n        .arg(mount_point)\n        .status()\n        .await\n        .context(\"failed to invoke `hdiutil detach`\")?;\n\n    if status.success() {\n        return Ok(());\n    }\n    anyhow::bail!(\"hdiutil detach failed with {status}\");\n}\n\nfn find_codex_app_in_mount(mount_point: &Path) -> anyhow::Result<PathBuf> {\n    let direct = mount_point.join(\"Codex.app\");\n    if direct.is_dir() {\n        return Ok(direct);\n    }\n\n    for entry in std::fs::read_dir(mount_point).with_context(|| {\n        format!(\n            \"failed to read {mount_point}\",\n            mount_point = mount_point.display()\n        )\n    })? {\n        let entry = entry.context(\"failed to read mount directory entry\")?;\n        let path = entry.path();\n        if path.extension().is_some_and(|ext| ext == \"app\") && path.is_dir() {\n            return Ok(path);","sourceCodeStart":273,"sourceCodeEnd":309,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/cli/src/desktop_app/mac.rs#L273-L309","documentation":"Error \"hdiutil detach failed with {status}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/cli/src/desktop_app/mac.rs:291 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"}