{"record":{"id":"67f38366f703470f","repo":"zed-industries/zed","slug":"failed-to-extract-to","errorCode":null,"errorMessage":"failed to extract {:?} to {:?}: {:?}","messagePattern":"failed to extract (.+?) to (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/auto_update/src/auto_update.rs","lineNumber":1113,"sourceCode":") -> Result<Option<PathBuf>> {\n    let home_dir = PathBuf::from(env::var(\"HOME\").context(\"no HOME env var set\")?);\n\n    let extracted = temp_dir.path().join(\"zed\");\n    fs::create_dir_all(&extracted)\n        .await\n        .context(\"failed to create directory into which to extract update\")?;\n\n    let mut cmd = new_command(\"tar\");\n    cmd.arg(\"-xzf\")\n        .arg(&downloaded_tar_gz)\n        .arg(\"-C\")\n        .arg(&extracted);\n    let output = cmd\n        .output()\n        .await\n        .with_context(|| \"failed to extract: {cmd}\")?;\n\n    anyhow::ensure!(\n        output.status.success(),\n        \"failed to extract {:?} to {:?}: {:?}\",\n        downloaded_tar_gz,\n        extracted,\n        String::from_utf8_lossy(&output.stderr)\n    );\n\n    let suffix = if channel != \"stable\" {\n        format!(\"-{}\", channel)\n    } else {\n        String::default()\n    };\n    let app_folder_name = format!(\"zed{}.app\", suffix);\n\n    let from = extracted.join(&app_folder_name);\n    let mut to = home_dir.join(\".local\");\n\n    let expected_suffix = format!(\"{}/libexec/zed-editor\", app_folder_name);","sourceCodeStart":1095,"sourceCodeEnd":1131,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/crates/auto_update/src/auto_update.rs#L1095-L1131","documentation":"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).","triggerScenarios":"tar exits non-zero: truncated or corrupt download, tar not installed or built without gzip, target directory not writable, or disk full.","commonSituations":"Interrupted downloads leaving a partial archive; minimal container/WSL images without tar; full disks; read-only /tmp via TMPDIR overrides.","solutions":["Free disk space and retry the update so a fresh archive downloads.","Confirm tar works: `tar --version`, then `tar -xzf <cached.tar.gz> -C /tmp/test` to reproduce the stderr.","Check TMPDIR and the extract directory are writable.","On WSL/minimal images, install tar (e.g. apt install tar)."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"anyhow::ensure!(which::which(\"tar\").is_ok(), \"tar is required to install updates\");\nlet available = fs2::free_space(extract_parent)?;\nanyhow::ensure!(available > archive_len * 3, \"not enough disk space to extract the update\");","typeGuard":null,"tryCatchPattern":"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.","preventionTips":["Verify tar and gzip support on minimal systems","Keep 2-3x the archive size free on the temp volume","Do not manually touch the installer temp dir mid-update"],"tags":["linux","tar","extraction","auto-update","disk-space"],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}