{"record":{"id":"413a38a707b09bbc","repo":"tonhowtf/omniget","slug":"o-pacote-do-onnx-runtime-baixado-n-o-confere-esperava-sha256","errorCode":null,"errorMessage":"o pacote do ONNX Runtime baixado não confere: esperava sha256 {expected}, veio {got}","messagePattern":"o pacote do ONNX Runtime baixado não confere: esperava sha256 (.+?), veio (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/onnxrt.rs","lineNumber":485,"sourceCode":"    let asset_file = asset.file.to_string();\n    let expected = asset.sha256.to_string();\n    let is_zip = asset_file.ends_with(\".zip\");\n    let dir_for_task = dir.clone();\n    let tmp_for_task = tmp.clone();\n    let p = progress.clone();\n    let out = tokio::task::spawn_blocking(move || -> anyhow::Result<PathBuf> {\n        crate::core::tools::report(\n            &p,\n            \"onnxruntime\",\n            \"verify\",\n            0,\n            None,\n            Some(\"conferindo sha256\".into()),\n        );\n        let got = sha256_of(&tmp_for_task)?;\n        if got != expected {\n            let _ = std::fs::remove_file(&tmp_for_task);\n            return Err(anyhow!(\n                \"o pacote do ONNX Runtime baixado não confere: esperava sha256 {expected}, veio {got}\"\n            ));\n        }\n        crate::core::tools::report(\n            &p,\n            \"onnxruntime\",\n            \"extract\",\n            0,\n            None,\n            Some(\"extraindo\".into()),\n        );\n        let extracted = extract_libs(&tmp_for_task, is_zip, &dir_for_task)?;\n        let canonical = make_canonical(&dir_for_task, &extracted)?;\n        let _ = std::fs::remove_file(&tmp_for_task);\n        Ok(canonical)\n    })\n    .await\n    .map_err(|e| anyhow!(\"tarefa de extração falhou: {e}\"))??;","sourceCodeStart":467,"sourceCodeEnd":503,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/onnxrt.rs#L467-L503","documentation":"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.","triggerScenarios":"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.","commonSituations":"Unstable network truncating the download; corporate proxy intercepting TLS and altering content; upstream maintainer re-uploaded the release asset without bumping the version.","solutions":["Re-run install_runtime to re-download the package (transient corruption)","Verify your network/proxy is not modifying downloads (disable TLS interception)","Check the upstream release — if the asset was re-published, update the expected checksum metadata in omniget-core","Pin the exact asset file and verify its checksum manually against GitHub releases"],"exampleFix":"// before\nlet url = format!(\"{RELEASE_BASE}/latest/onnxruntime.tgz\"); // asset silently re-published\n// after\nlet url = format!(\"{RELEASE_BASE}/v{RUNTIME_VERSION}/onnxruntime-v{RUNTIME_VERSION}.tgz\"); // immutable asset","handlingStrategy":"retry","validationCode":"let sha = sha256_of(&tmp)?; println!(\"sha256 {}\", sha); // compare with release metadata before install","typeGuard":null,"tryCatchPattern":"match install_runtime(None, &progress).await { Err(e) if e.to_string().contains(\"sha256\") => { purge_tmp(); retry_once_with_fresh_download().await } ... }","preventionTips":["Re-download on checksum failure with a cleaned temp file","Bypass TLS-intercepting proxies for release downloads","Verify checksums against upstream GitHub release notes on version bumps"],"tags":["onnx","security","sha256","download"],"backgroundTag":"checksum-mismatch","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}