tonhowtf/omniget · error

o pacote nao contem o

Error message

o pacote nao contem o {}

What it means

After unpacking the Real-ESRGAN archive into a staging directory, install() searches for the expected binary with github::find_file. If the binary (matched by bin_name(BIN)) is absent, it removes the staging dir and throws 'o pacote nao contem o {BIN}'. This is a post-download sanity check on the release archive contents.

Solutions

  1. Check which asset was downloaded (asset.name) and inspect its contents against bin_name(BIN)
  2. Pin/verify the expected REPO release layout — upstream may have renamed the binary in newer releases
  3. Extend asset_pick or bin_name to accept the new naming scheme
  4. Retry install to rule out a corrupted/partial extraction
Defensive patterns

Strategy: fallback

Validate before calling

// after install, sanity-check the expected binary name
downloaded_assets.iter().all(|a| a.name.ends_with(".zip")) && asset.name.contains(expected_os)

Try / catch

match upscale::install(&progress).await {
    Err(e) if e.to_string().contains("o pacote nao contem") => {
        eprintln!("Release do upstream mudou; atualize asset_pick/bin_name.");
    }
    other => other,
}

Prevention

When it happens

Trigger: The GitHub release asset for the detected OS does not contain the expected executable name (realesrgan-ncnn-vulkan variant), so find_file returns None after successful unpacking.

Common situations: Upstream release renamed binaries or changed archive layout; asset_pick matched a zip for the wrong OS/architecture; partial unzip skipped the binary due to an archive error.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


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

Appendix: source

Thrown at src-tauri/omniget-core/src/core/tools/upscale.rs:94

    };
    name.starts_with("realesrgan-ncnn-vulkan") && name.contains(os) && name.ends_with(".zip")
}

pub async fn install(progress: super::ProgressFn) -> anyhow::Result<String> {
    let dir = managed_dir().ok_or_else(|| anyhow!("Could not determine data directory"))?;
    let client = github::client()?;
    let asset = github::asset(&client, REPO, None, asset_pick).await?;
    // Release de 2022: a API não tem digest para esses assets.
    let data = github::download(&client, &asset, true, &progress, BIN).await?;
    let staging = dir.with_extension("new");
    let _ = std::fs::remove_dir_all(&staging);
    let (s2, n2) = (staging.clone(), asset.name.clone());
    tokio::task::spawn_blocking(move || github::unpack(&data, &n2, &s2))
        .await
        .map_err(|e| anyhow!("Spawn blocking failed: {}", e))??;
    let Some(exe) = github::find_file(&staging, &bin_name(BIN)) else {
        let _ = std::fs::remove_dir_all(&staging);
        return Err(anyhow!("o pacote nao contem o {}", BIN));
    };
    github::make_executable(&exe);
    github::swap_dir(&staging, &dir)?;
    github::strip_quarantine(&dir).await;
    locate()
        .map(|p| p.to_string_lossy().to_string())
        .ok_or_else(|| anyhow!("binario sumiu apos instalar"))
}

#[derive(Debug, Clone, Deserialize)]
pub struct UpscaleOptions {
    pub inputs: Vec<String>,
    #[serde(default = "default_model")]
    pub model: String,
    #[serde(default = "default_scale")]
    pub scale: u32,
    /// "png" | "jpg" | "webp"
    #[serde(default = "default_fmt")]

View on GitHub (pinned to 8600b91f42)