{"record":{"id":"8ae26af4163368df","repo":"zed-industries/zed","slug":"failed-to-copy-zed-update-from-to","errorCode":null,"errorMessage":"failed to copy Zed update from {:?} to {:?}: {:?}","messagePattern":"failed to copy Zed update from (.+?) to (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/auto_update/src/auto_update.rs","lineNumber":1147,"sourceCode":"    let mut to = home_dir.join(\".local\");\n\n    let expected_suffix = format!(\"{}/libexec/zed-editor\", app_folder_name);\n\n    if let Some(prefix) = running_app_path\n        .to_str()\n        .and_then(|str| str.strip_suffix(&expected_suffix))\n    {\n        to = PathBuf::from(prefix);\n    }\n\n    let mut cmd = new_command(\"rsync\");\n    cmd.args([\"-av\", \"--delete\"]).arg(&from).arg(&to);\n    let output = cmd\n        .output()\n        .await\n        .with_context(|| \"failed to rsync: {cmd}\")?;\n\n    anyhow::ensure!(\n        output.status.success(),\n        \"failed to copy Zed update from {:?} to {:?}: {:?}\",\n        from,\n        to,\n        String::from_utf8_lossy(&output.stderr)\n    );\n\n    Ok(Some(to.join(expected_suffix)))\n}\n\nasync fn install_release_macos(\n    temp_dir: &InstallerDir,\n    downloaded_dmg: &Path,\n    running_app_path: PathBuf,\n    background_executor: &BackgroundExecutor,\n) -> Result<Option<PathBuf>> {\n    let running_app_filename = running_app_path\n        .file_name()","sourceCodeStart":1129,"sourceCodeEnd":1165,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/crates/auto_update/src/auto_update.rs#L1129-L1165","documentation":"Linux install step: the extracted tree is synced into the install prefix with `rsync -av --delete <from> <to>`; non-zero exit reports the from/to paths and rsync's stderr. Because --delete is destructive on the destination, a failure here can leave a partially synced install directory.","triggerScenarios":"rsync exits non-zero: no write permission on the install prefix, rsync missing at run time, cross-filesystem or argument errors, or files locked by a running process.","commonSituations":"System-wide installs under /opt or /usr owned by root while the update runs as the user; custom install locations; antivirus holding files open.","solutions":["Fix ownership of the install directory: `sudo chown -R $(whoami) <zed-install-dir>`, or reinstall Zed to a user-writable path.","Verify rsync is installed and executable: `rsync --version`.","Retry the update after closing other Zed/remote-server processes.","If the install is now partial, reinstall from a fresh download."],"exampleFix":"# before: update fails, /opt/zed owned by root\nls -ld /opt/zed   # drwxr-xr-x  root root\n\n# after: make the install dir writable by the updating user\nsudo chown -R $(whoami) /opt/zed","handlingStrategy":"validation","validationCode":"anyhow::ensure!(which::which(\"rsync\").is_ok(), \"rsync is required\");\nlet probe = install_dir.join(\".zed-update-probe\");\nstd::fs::File::create(&probe).context(\"install dir not writable\")?;\nstd::fs::remove_file(&probe)?;","typeGuard":null,"tryCatchPattern":"on rsync failure, inspect stderr for 'Permission denied'; fix ownership of the install prefix and retry, otherwise fall back to a manual reinstall since --delete may have left a partial copy.","preventionTips":["Install Zed in a user-writable location","chown system-wide installs to the user that runs updates","Keep rsync installed - it is a hard dependency on Linux"],"tags":["linux","rsync","permissions","auto-update"],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}