tonhowtf/omniget · error · anyhow::Error
nao foi possivel buscar
Error message
nao foi possivel buscar {}: {} What it means
Thrown by expected_from_sums_url when the HTTP request to fetch a sha256sums file fails at the transport level (reqwest send() error). It wraps the underlying reqwest error with the requested URL for context. This is the network-failure branch of the checksum-manifest fetch, distinct from a non-success HTTP status.
Solutions
- Verify network connectivity and DNS resolution for the sums_url host (curl -I <sums_url>).
- Check proxy/VPN/firewall settings that may block egress HTTPS.
- Retry the download; transient network errors often resolve.
- Inspect the wrapped reqwest error in the message for the precise cause (timeout vs DNS vs TLS).
Example fix
// before
let hash = dependencies::expected_from_sums_url(&client, &sums_url, "ffmpeg").await?;
// after
let hash = match dependencies::expected_from_sums_url(&client, &sums_url, "ffmpeg").await {
Ok(h) => h,
Err(e) => { log::warn!("checksum fetch failed, will rebuild: {e}"); return Err(e); }
}; Defensive patterns
Strategy: retry
Validate before calling
// Rust: preflight reachability check before fetching sums
async fn sums_reachable(client: &reqwest::Client, url: &str) -> bool {
matches!(client.get(url).send().await, Ok(_))
} Try / catch
match expected_from_sums_url(&client, &sums_url, asset).await {
Ok(h) => h,
Err(e) => { log::warn!("network error fetching sums: {e:#}"); backoff_retry_or_fail(e) }
} Prevention
- Retry with exponential backoff on transient network errors.
- Precheck connectivity/DNS before starting long download flows.
- Surface the wrapped reqwest error to logs for diagnosis.
When it happens
Trigger: Calling expected_from_sums_url (directly or via download_ffmpeg/update_ffmpeg) when client.get(sums_url).send().await returns Err: DNS failure, connection refused/timeout, TLS error, or no network interface.
Common situations: Machine offline or behind a captive portal; corporate proxy blocking the host; DNS misconfiguration; firewall egress rules; sums_url pointing at a host that no longer resolves.
Related errors
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/c657680054ec00ee.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/omniget-core/src/core/dependencies.rs:90
"{}: hash nao confere — esperado {}, obtido {}. Download descartado.",
label,
expected,
actual
))
}
/// Busca o hash esperado num arquivo de sums remoto. `Err` quando a origem
/// publica sums mas não conseguimos obtê-los — o chamador deve abortar.
pub async fn expected_from_sums_url(
client: &reqwest::Client,
sums_url: &str,
asset: &str,
) -> anyhow::Result<String> {
let response = client
.get(sums_url)
.send()
.await
.map_err(|e| anyhow!("nao foi possivel buscar {}: {}", sums_url, e))?;
if !response.status().is_success() {
return Err(anyhow!(
"nao foi possivel buscar {}: HTTP {}",
sums_url,
response.status()
));
}
let text = response
.text()
.await
.map_err(|e| anyhow!("corpo ilegivel de {}: {}", sums_url, e))?;
parse_sha256sums(&text, asset)
.or_else(|| parse_single_sha256(&text))
.ok_or_else(|| anyhow!("{} nao esta listado em {}", asset, sums_url))
}
}
pub fn bin_name(tool: &str) -> String {View on GitHub (pinned to 8600b91f42)