tonhowtf/omniget · error · anyhow::Error
release de sem assets
Error message
release de {} sem assets What it means
`latest_asset` parsed the latest release JSON but the `assets` field is missing or not an array, so there is nothing to pick from. The library treats a release without an assets array as a hard failure since it cannot download anything.
Solutions
- Check the latest release page on GitHub for the repo and confirm it has attached binaries
- If the latest release is source-only, wait for/pin to a previous release that has assets
- Inspect the raw API response (curl https://api.github.com/repos/{repo}/releases/latest) to see the actual shape
- Add a GitHub token and re-fetch to rule out a truncated rate-limited response
Example fix
// before
let assets = json["assets"].as_array().ok_or_else(|| anyhow!("release de {} sem assets", repo))?;
// after
if json["assets"].as_array().map_or(true, |a| a.is_empty()) {
// fall back to listing all releases and picking one with assets
return pick_release_with_assets(&client, repo).await;
} Defensive patterns
Strategy: fallback
Validate before calling
let json: serde_json::Value = client.get(url).send().await?.json().await?;
let has_assets = json["assets"].as_array().map_or(false, |a| !a.is_empty());
if !has_assets { eprintln!("latest release has no assets; consider older release"); } Try / catch
match latest_asset(&client, repo, pick).await {
Err(e) if e.to_string().contains("sem assets") => pick_from_older_releases(&client, repo, pick).await,
other => other,
} Prevention
- Fall back to listing `/releases` and picking the newest release that has matching assets
- Log the raw JSON when this fires to detect API schema changes early
- Prefer repos that consistently publish binaries; check releases page before integrating
When it happens
Trigger: The latest GitHub release for the repo has no assets, or the API response shape changed (e.g. an error body that still passed the status check).
Common situations: A repo published a source-only release (no binaries); a draft or odd release marked latest; GitHub API schema change or a cached/proxied malformed response.
Related errors
- nao foi possivel consultar releases de
- veio sem digest da API do GitHub; download descartado
- a saída do gallery-dl não é um dump JSON válido
- Post does not contain media
- Resposta GQL sem data
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/f15543899152300b.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/omniget-core/src/core/spicetify.rs:392
async fn latest_asset(
client: &reqwest::Client,
repo: &str,
pick: impl Fn(&str) -> bool,
) -> anyhow::Result<ReleaseAsset> {
let url = format!("https://api.github.com/repos/{}/releases/latest", repo);
let response = client.get(&url).send().await?;
if !response.status().is_success() {
return Err(anyhow!(
"nao foi possivel consultar releases de {}: HTTP {}",
repo,
response.status()
));
}
let json: serde_json::Value = response.json().await?;
let tag = json["tag_name"].as_str().unwrap_or("").to_string();
let assets = json["assets"]
.as_array()
.ok_or_else(|| anyhow!("release de {} sem assets", repo))?;
for asset in assets {
let name = asset["name"].as_str().unwrap_or("");
if pick(name) {
return Ok(ReleaseAsset {
tag: tag.clone(),
name: name.to_string(),
url: asset["browser_download_url"]
.as_str()
.unwrap_or("")
.to_string(),
digest: asset["digest"]
.as_str()
.and_then(integrity::parse_github_digest),
});
}
}
Err(anyhow!(
"release {} de {} nao tem um asset para este sistema",View on GitHub (pinned to 8600b91f42)