{"record":{"id":"371b921afb476825","repo":"tonhowtf/omniget","slug":"o-pacote-nao-contem-o","errorCode":null,"errorMessage":"o pacote nao contem o {}","messagePattern":"o pacote nao contem o (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/upscale.rs","lineNumber":94,"sourceCode":"    };\n    name.starts_with(\"realesrgan-ncnn-vulkan\") && name.contains(os) && name.ends_with(\".zip\")\n}\n\npub async fn install(progress: super::ProgressFn) -> anyhow::Result<String> {\n    let dir = managed_dir().ok_or_else(|| anyhow!(\"Could not determine data directory\"))?;\n    let client = github::client()?;\n    let asset = github::asset(&client, REPO, None, asset_pick).await?;\n    // Release de 2022: a API não tem digest para esses assets.\n    let data = github::download(&client, &asset, true, &progress, BIN).await?;\n    let staging = dir.with_extension(\"new\");\n    let _ = std::fs::remove_dir_all(&staging);\n    let (s2, n2) = (staging.clone(), asset.name.clone());\n    tokio::task::spawn_blocking(move || github::unpack(&data, &n2, &s2))\n        .await\n        .map_err(|e| anyhow!(\"Spawn blocking failed: {}\", e))??;\n    let Some(exe) = github::find_file(&staging, &bin_name(BIN)) else {\n        let _ = std::fs::remove_dir_all(&staging);\n        return Err(anyhow!(\"o pacote nao contem o {}\", BIN));\n    };\n    github::make_executable(&exe);\n    github::swap_dir(&staging, &dir)?;\n    github::strip_quarantine(&dir).await;\n    locate()\n        .map(|p| p.to_string_lossy().to_string())\n        .ok_or_else(|| anyhow!(\"binario sumiu apos instalar\"))\n}\n\n#[derive(Debug, Clone, Deserialize)]\npub struct UpscaleOptions {\n    pub inputs: Vec<String>,\n    #[serde(default = \"default_model\")]\n    pub model: String,\n    #[serde(default = \"default_scale\")]\n    pub scale: u32,\n    /// \"png\" | \"jpg\" | \"webp\"\n    #[serde(default = \"default_fmt\")]","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/upscale.rs#L76-L112","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check which asset was downloaded (asset.name) and inspect its contents against bin_name(BIN)","Pin/verify the expected REPO release layout — upstream may have renamed the binary in newer releases","Extend asset_pick or bin_name to accept the new naming scheme","Retry install to rule out a corrupted/partial extraction"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// after install, sanity-check the expected binary name\ndownloaded_assets.iter().all(|a| a.name.ends_with(\".zip\")) && asset.name.contains(expected_os)","typeGuard":null,"tryCatchPattern":"match upscale::install(&progress).await {\n    Err(e) if e.to_string().contains(\"o pacote nao contem\") => {\n        eprintln!(\"Release do upstream mudou; atualize asset_pick/bin_name.\");\n    }\n    other => other,\n}","preventionTips":["Pin or monitor the upstream release layout for renames","Make asset_pick verify the OS/arch marker in the asset name","Log the downloaded asset name with the error for diagnosis"],"tags":["installation","packaging","upstream","github-releases","rust"],"backgroundTag":"file-not-found","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}