tonhowtf/omniget · error
Spawn blocking failed
Error message
Spawn blocking failed: {} What it means
The blocking unpack task spawned with tokio::task::spawn_blocking aborted before completing (its JoinHandle returned a JoinError), which install maps to "Spawn blocking failed: {}". This is a tokio runtime-level failure, not an unpack failure — the worker task was cancelled or the blocking pool panicked.
Solutions
- Inspect the wrapped JoinError source to find the panic inside unpack_zip/unpack_tar_gz
- Retry the install after verifying the archive downloaded intact (download_verified checksum)
- Avoid shutting down the runtime while install is in flight
- Harden unpack_* against malformed archives so they return Err instead of panicking
Defensive patterns
Strategy: retry
Try / catch
match install().await {
Err(e) if e.to_string().starts_with("Spawn blocking failed") => {
log_cause(&e);
retry_with_backoff(install, 2).await;
}
other => handle(other),
} Prevention
- Don't shut down the tokio runtime while installs are running
- Keep unpack_* panic-free: validate archive entries before extraction
- Verify download checksums before unpacking
When it happens
Trigger: Calling install when the blocking task panics inside unpack_zip/unpack_tar_gz, or the runtime shuts down / task is cancelled while unpacking the Spicetify CLI archive.
Common situations: Panic inside the zip/tar extractor (e.g. malicious or malformed archive paths); app shutting down mid-install; blocking thread pool exhaustion causing cancellation.
Related errors
- host semaphore closed unexpectedly
- Send cancelled while paused
- spawn_blocking failed
- Failed to move into place
- spawn_blocking failed
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/f50116f454a13a83.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/omniget-core/src/core/spicetify.rs:535
let client = github_client()?;
let asset = latest_asset(&client, CLI_REPO, |n| n.ends_with(suffix)).await?;
tracing::info!("[spicetify] baixando {} ({})", asset.name, asset.tag);
let data = download_verified(&client, &asset).await?;
let staging = dir.with_extension("new");
let _ = std::fs::remove_dir_all(&staging);
std::fs::create_dir_all(&staging)?;
let is_zip = asset.name.ends_with(".zip");
let staging_clone = staging.clone();
tokio::task::spawn_blocking(move || {
if is_zip {
unpack_zip(&data, &staging_clone)
} else {
unpack_tar_gz(&data, &staging_clone)
}
})
.await
.map_err(|e| anyhow!("Spawn blocking failed: {}", e))??;
let exe = staging.join(bin_name("spicetify"));
if !exe.exists() {
let _ = std::fs::remove_dir_all(&staging);
return Err(anyhow!(
"o arquivo baixado nao contem o executavel do spicetify"
));
}
make_executable(&exe);
let old = dir.with_extension("old");
let _ = std::fs::remove_dir_all(&old);
if dir.exists() {
std::fs::rename(&dir, &old)?;
}
if let Err(e) = std::fs::rename(&staging, &dir) {
if old.exists() {
let _ = std::fs::rename(&old, &dir);View on GitHub (pinned to 8600b91f42)