Kuberwastaken/claurst · error
tar -xf returned non-zero exit status
Error message
tar -xf returned non-zero exit status: {} What it means
Windows extraction path: both the PowerShell Expand-Archive fallback and the bsdtar `tar -xf` invocation exited with a non-zero status (formatted exit code). The archive exists but could not be extracted — likely corrupted download, disk-full, or a blocked path.
Solutions
- Retry the upgrade; a truncated download is the most common cause
- Free disk space and check the temp directory is writable
- Extract the archive manually with File Explorer or `tar -xf` to see the underlying error
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at src-rust/crates/cli/src/upgrade.rs:253 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Kuberwastaken/claurst@b0637c97ec (2026-09-10).
Data as JSON: /api/errors/ed0e07e505263eeb.
Report an issue: GitHub.
Appendix: source
Thrown at src-rust/crates/cli/src/upgrade.rs:253
&format!(
"Expand-Archive -Path '{}' -DestinationPath '{}' -Force",
archive.display(),
dest.display()
),
])
.status();
if let Ok(s) = ps_status {
if s.success() {
return Ok(());
}
}
// tar -xf works on Windows 10+ via bsdtar.
let status = std::process::Command::new("tar")
.args(["-xf", &archive.to_string_lossy(), "-C", &dest.to_string_lossy()])
.status()
.context("failed to spawn tar")?;
if !status.success() {
bail!("tar -xf returned non-zero exit status: {}", status);
}
Ok(())
} else {
let status = std::process::Command::new("tar")
.args(["-xzf", &archive.to_string_lossy(), "-C", &dest.to_string_lossy()])
.status()
.context("failed to spawn tar")?;
if !status.success() {
bail!("tar -xzf returned non-zero exit status: {}", status);
}
Ok(())
}
}
// Shallow walker (avoids pulling walkdir crate just for this).
fn walkdir_shallow(root: &Path, max_depth: usize) -> Vec<PathBuf> {
fn rec(dir: &Path, depth_left: usize, out: &mut Vec<PathBuf>) {
if depth_left == 0 {View on GitHub (pinned to b0637c97ec)