{"record":{"id":"c40f2bb7af2ce26f","repo":"zed-industries/zed","slug":"failed-to-copy-app","errorCode":null,"errorMessage":"failed to copy app: {:?}","messagePattern":"failed to copy app: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/auto_update/src/auto_update.rs","lineNumber":1244,"sourceCode":"\n    let unmounter = MacOsUnmounter {\n        mount_path: mount_path.clone(),\n        background_executor,\n    };\n\n    let mut cmd = new_command(\"rsync\");\n    cmd.args([\"-av\", \"--delete\", \"--exclude\", \"Icon?\"])\n        .arg(&mounted_app_path)\n        .arg(&running_app_path);\n    let rsync_output = cmd.output().await;\n\n    // Await the unmount (even if rsync failed) so that the installer temp dir\n    // can be deleted once this function returns.\n    unmounter.unmount().await;\n\n    let output = rsync_output.with_context(|| \"failed to rsync: {cmd}\")?;\n\n    anyhow::ensure!(\n        output.status.success(),\n        \"failed to copy app: {:?}\",\n        String::from_utf8_lossy(&output.stderr)\n    );\n\n    Ok(None)\n}\n\n/// Removes stale installer dirs from the system temp dir. Older Zed versions\n/// leaked one per update by deleting the dir while the downloaded disk image\n/// was still mounted inside it, which made the deletion fail silently.\n#[cfg(any(rust_analyzer, all(not(target_os = \"windows\"), not(test))))]\nasync fn cleanup_stale_installer_dirs() {\n    const STALE_INSTALLER_DIR_AGE: Duration = Duration::from_secs(24 * 60 * 60);\n\n    let temp_dir = std::env::temp_dir();\n    let Ok(mut entries) = fs::read_dir(&temp_dir).await else {\n        log::warn!(\"failed to read temp dir {temp_dir:?} while cleaning up installer dirs\");","sourceCodeStart":1226,"sourceCodeEnd":1262,"githubUrl":"https://github.com/zed-industries/zed/blob/916fc2b8cb3a815cbef4a3b40e13081be72036b6/crates/auto_update/src/auto_update.rs#L1226-L1262","documentation":"install_release_macos rsyncs the mounted app bundle over the running .app and then awaits the unmount; if the rsync child process failed to even run (its output is wrapped with 'failed to rsync'), the error 'failed to copy app' reports the non-zero outcome, meaning the update payload could not be synced onto the installed app bundle.","triggerScenarios":"Thrown at crates/auto_update/src/auto_update.rs:1233 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure rsync is installed (macOS updates depend on it) and retry the update","Check that the running .app path is writable and not quarantined by Gatekeeper mid-copy","Free disk space and retry if the bundle copy was partial"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"916fc2b8cb3a815cbef4a3b40e13081be72036b6","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}