{"record":{"id":"f50116f454a13a83","repo":"tonhowtf/omniget","slug":"spawn-blocking-failed-spicetify","errorCode":null,"errorMessage":"Spawn blocking failed: {}","messagePattern":"Spawn blocking failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/spicetify.rs","lineNumber":535,"sourceCode":"    let client = github_client()?;\n    let asset = latest_asset(&client, CLI_REPO, |n| n.ends_with(suffix)).await?;\n    tracing::info!(\"[spicetify] baixando {} ({})\", asset.name, asset.tag);\n    let data = download_verified(&client, &asset).await?;\n\n    let staging = dir.with_extension(\"new\");\n    let _ = std::fs::remove_dir_all(&staging);\n    std::fs::create_dir_all(&staging)?;\n    let is_zip = asset.name.ends_with(\".zip\");\n    let staging_clone = staging.clone();\n    tokio::task::spawn_blocking(move || {\n        if is_zip {\n            unpack_zip(&data, &staging_clone)\n        } else {\n            unpack_tar_gz(&data, &staging_clone)\n        }\n    })\n    .await\n    .map_err(|e| anyhow!(\"Spawn blocking failed: {}\", e))??;\n\n    let exe = staging.join(bin_name(\"spicetify\"));\n    if !exe.exists() {\n        let _ = std::fs::remove_dir_all(&staging);\n        return Err(anyhow!(\n            \"o arquivo baixado nao contem o executavel do spicetify\"\n        ));\n    }\n    make_executable(&exe);\n\n    let old = dir.with_extension(\"old\");\n    let _ = std::fs::remove_dir_all(&old);\n    if dir.exists() {\n        std::fs::rename(&dir, &old)?;\n    }\n    if let Err(e) = std::fs::rename(&staging, &dir) {\n        if old.exists() {\n            let _ = std::fs::rename(&old, &dir);","sourceCodeStart":517,"sourceCodeEnd":553,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/spicetify.rs#L517-L553","documentation":"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.","triggerScenarios":"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.","commonSituations":"Panic inside the zip/tar extractor (e.g. malicious or malformed archive paths); app shutting down mid-install; blocking thread pool exhaustion causing cancellation.","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"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match install().await {\n    Err(e) if e.to_string().starts_with(\"Spawn blocking failed\") => {\n        log_cause(&e);\n        retry_with_backoff(install, 2).await;\n    }\n    other => handle(other),\n}","preventionTips":["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"],"tags":["tokio","concurrency","install"],"backgroundTag":"thread-interrupted","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}