zed-industries/zed · error

failed to extract {:?} to {:?}: {:?}

Error message

failed to extract {:?} to {:?}: {:?}

What it means

Linux install step: the updater runs `tar -xzf <downloaded.tar.gz> -C <extracted_dir>` and requires exit success; failure reports both paths plus tar's stderr, which names the concrete cause (corrupt archive, missing gzip support, no space, permission denied).

Source

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

) -> Result<Option<PathBuf>> {
    let home_dir = PathBuf::from(env::var("HOME").context("no HOME env var set")?);

    let extracted = temp_dir.path().join("zed");
    fs::create_dir_all(&extracted)
        .await
        .context("failed to create directory into which to extract update")?;

    let mut cmd = new_command("tar");
    cmd.arg("-xzf")
        .arg(&downloaded_tar_gz)
        .arg("-C")
        .arg(&extracted);
    let output = cmd
        .output()
        .await
        .with_context(|| "failed to extract: {cmd}")?;

    anyhow::ensure!(
        output.status.success(),
        "failed to extract {:?} to {:?}: {:?}",
        downloaded_tar_gz,
        extracted,
        String::from_utf8_lossy(&output.stderr)
    );

    let suffix = if channel != "stable" {
        format!("-{}", channel)
    } else {
        String::default()
    };
    let app_folder_name = format!("zed{}.app", suffix);

    let from = extracted.join(&app_folder_name);
    let mut to = home_dir.join(".local");

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

View on GitHub (pinned to bc538def45)

Solutions

  1. Free disk space and retry the update so a fresh archive downloads.
  2. Confirm tar works: `tar --version`, then `tar -xzf <cached.tar.gz> -C /tmp/test` to reproduce the stderr.
  3. Check TMPDIR and the extract directory are writable.
  4. On WSL/minimal images, install tar (e.g. apt install tar).
Defensive patterns

Strategy: retry

Validate before calling

anyhow::ensure!(which::which("tar").is_ok(), "tar is required to install updates");
let available = fs2::free_space(extract_parent)?;
anyhow::ensure!(available > archive_len * 3, "not enough disk space to extract the update");

Try / catch

on extraction failure, delete the cached archive and retry the whole update so a fresh download is attempted; escalate only if the second extract fails.

Prevention

When it happens

Trigger: tar exits non-zero: truncated or corrupt download, tar not installed or built without gzip, target directory not writable, or disk full.

Common situations: Interrupted downloads leaving a partial archive; minimal container/WSL images without tar; full disks; read-only /tmp via TMPDIR overrides.

Related errors


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