tonhowtf/omniget · error · anyhow::Error

o pacote do ONNX Runtime baixado não confere: esperava…

Error message

o pacote do ONNX Runtime baixado não confere: esperava sha256 {expected}, veio {got}

What it means

Raised by install_runtime() after download: the sha256 of the downloaded archive does not match the checksum recorded for the release asset. The library deletes the temp file and throws to prevent installing tampered or corrupted packages.

Solutions

  1. Re-run install_runtime to re-download the package (transient corruption)
  2. Verify your network/proxy is not modifying downloads (disable TLS interception)
  3. Check the upstream release — if the asset was re-published, update the expected checksum metadata in omniget-core
  4. Pin the exact asset file and verify its checksum manually against GitHub releases

Example fix

// before
let url = format!("{RELEASE_BASE}/latest/onnxruntime.tgz"); // asset silently re-published
// after
let url = format!("{RELEASE_BASE}/v{RUNTIME_VERSION}/onnxruntime-v{RUNTIME_VERSION}.tgz"); // immutable asset
Defensive patterns

Strategy: retry

Validate before calling

let sha = sha256_of(&tmp)?; println!("sha256 {}", sha); // compare with release metadata before install

Try / catch

match install_runtime(None, &progress).await { Err(e) if e.to_string().contains("sha256") => { purge_tmp(); retry_once_with_fresh_download().await } ... }

Prevention

When it happens

Trigger: install_runtime() downloads the ONNX Runtime package from RELEASE_BASE, hashes it with sha256_of, and got != expected — interrupted download, CDN caching a different/older asset, or the release was re-published with new binaries but old checksum metadata.

Common situations: Unstable network truncating the download; corporate proxy intercepting TLS and altering content; upstream maintainer re-uploaded the release asset without bumping the version.

Understand the failure class

Background: Checksum mismatch errors: "checksum verification failed", "digest mismatch", "expected vs actual checksum" — what they mean and how to fix them — this error's family across 41 libraries.

Related errors


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

Appendix: source

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

    let asset_file = asset.file.to_string();
    let expected = asset.sha256.to_string();
    let is_zip = asset_file.ends_with(".zip");
    let dir_for_task = dir.clone();
    let tmp_for_task = tmp.clone();
    let p = progress.clone();
    let out = tokio::task::spawn_blocking(move || -> anyhow::Result<PathBuf> {
        crate::core::tools::report(
            &p,
            "onnxruntime",
            "verify",
            0,
            None,
            Some("conferindo sha256".into()),
        );
        let got = sha256_of(&tmp_for_task)?;
        if got != expected {
            let _ = std::fs::remove_file(&tmp_for_task);
            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}"))??;

View on GitHub (pinned to 8600b91f42)