zed-industries/zed · error

failed to copy Zed update from {:?} to {:?}: {:?}

Error message

failed to copy Zed update from {:?} to {:?}: {:?}

What it means

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.

Source

Thrown at crates/auto_update/src/auto_update.rs:1147

    let mut to = home_dir.join(".local");

    let expected_suffix = format!("{}/libexec/zed-editor", app_folder_name);

    if let Some(prefix) = running_app_path
        .to_str()
        .and_then(|str| str.strip_suffix(&expected_suffix))
    {
        to = PathBuf::from(prefix);
    }

    let mut cmd = new_command("rsync");
    cmd.args(["-av", "--delete"]).arg(&from).arg(&to);
    let output = cmd
        .output()
        .await
        .with_context(|| "failed to rsync: {cmd}")?;

    anyhow::ensure!(
        output.status.success(),
        "failed to copy Zed update from {:?} to {:?}: {:?}",
        from,
        to,
        String::from_utf8_lossy(&output.stderr)
    );

    Ok(Some(to.join(expected_suffix)))
}

async fn install_release_macos(
    temp_dir: &InstallerDir,
    downloaded_dmg: &Path,
    running_app_path: PathBuf,
    background_executor: &BackgroundExecutor,
) -> Result<Option<PathBuf>> {
    let running_app_filename = running_app_path
        .file_name()

View on GitHub (pinned to bc538def45)

Solutions

  1. Fix ownership of the install directory: `sudo chown -R $(whoami) <zed-install-dir>`, or reinstall Zed to a user-writable path.
  2. Verify rsync is installed and executable: `rsync --version`.
  3. Retry the update after closing other Zed/remote-server processes.
  4. If the install is now partial, reinstall from a fresh download.

Example fix

# before: update fails, /opt/zed owned by root
ls -ld /opt/zed   # drwxr-xr-x  root root

# after: make the install dir writable by the updating user
sudo chown -R $(whoami) /opt/zed
Defensive patterns

Strategy: validation

Validate before calling

anyhow::ensure!(which::which("rsync").is_ok(), "rsync is required");
let probe = install_dir.join(".zed-update-probe");
std::fs::File::create(&probe).context("install dir not writable")?;
std::fs::remove_file(&probe)?;

Try / catch

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.

Prevention

When it happens

Trigger: 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.

Common situations: System-wide installs under /opt or /usr owned by root while the update runs as the user; custom install locations; antivirus holding files open.

Related errors


AI-assisted analysis of zed-industries/zed@bc538def45 (2026-08-16). Data as JSON: /api/errors/8ae26af4163368df. Report an issue: GitHub.