tonhowtf/omniget · error · anyhow::Error

tarefa de extração falhou

Error message

tarefa de extração falhou: {e}

What it means

Raised by install_runtime() when the blocking extraction task spawned with spawn_blocking (extract_libs + make_canonical) returns an Err; the JoinError/inner error is wrapped as 'tarefa de extração falhou: {e}'. It is a wrapper — the real cause is the inner error message.

Solutions

  1. Read the {e} suffix for the underlying cause and fix that (permissions, disk space, archive)
  2. Free disk space in the app data partition and retry installation
  3. Ensure the target directory is writable by the current user
  4. Re-download the package if the archive itself is corrupt

Example fix

// before
.map_err(|e| anyhow!("tarefa de extração falhou: {e}"))??; // opaque
// after
.map_err(|e| anyhow!("tarefa de extração falhou: {e:#}")/* chain includes inner cause */)?;
Defensive patterns

Strategy: try-catch

Validate before calling

if free_space(data_dir)? < 500_000_000 { return Err(anyhow!("insufficient disk space")); }

Try / catch

match install_runtime(None, &progress).await { Err(e) => { eprintln!("{e:#}"); /* walk the anyhow chain for the real cause */ } }

Prevention

When it happens

Trigger: install_runtime()'s spawn_blocking closure fails: extract_libs hits an IO error (disk full, permissions) or the empty-library error, or make_canonical fails; the panic/join error is then re-wrapped by anyhow!.

Common situations: Disk full in the data dir during extraction; permission denied writing into the target directory; inner archive errors (bad zip/tgz); task panicked inside extract_libs on unexpected archive layout.

Understand the failure class

Background: "failed to write file", "Could not save figure", "Error saving remote file" — file write failed: causes and fixes across languages and libraries — this error's family across 38 libraries.

Related errors


AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12). Data as JSON: /api/errors/74a249c002e06ab0. Report an issue: GitHub.

Appendix: source

Thrown at src-tauri/omniget-core/src/core/onnxrt.rs:503

            return Err(anyhow!(
                "o pacote do ONNX Runtime baixado não confere: esperava sha256 {expected}, veio {got}"
            ));
        }
        crate::core::tools::report(
            &p,
            "onnxruntime",
            "extract",
            0,
            None,
            Some("extraindo".into()),
        );
        let extracted = extract_libs(&tmp_for_task, is_zip, &dir_for_task)?;
        let canonical = make_canonical(&dir_for_task, &extracted)?;
        let _ = std::fs::remove_file(&tmp_for_task);
        Ok(canonical)
    })
    .await
    .map_err(|e| anyhow!("tarefa de extração falhou: {e}"))??;

    if let Some(marker) = version_marker_path() {
        let _ = std::fs::write(&marker, format!("{} ({})", RUNTIME_VERSION, asset.file));
    }
    strip_quarantine(&out).await;
    crate::core::tools::report(progress, "onnxruntime", "done", 1, Some(1), None);
    Ok(out)
}

/// Instala a partir de um arquivo que o usuário já tem no disco.
pub fn install_from_path(source: &Path) -> anyhow::Result<PathBuf> {
    if !source.is_file() {
        return Err(anyhow!("{} não é um arquivo", source.display()));
    }
    let name = source
        .file_name()
        .and_then(|s| s.to_str())
        .unwrap_or_default();

View on GitHub (pinned to 8600b91f42)