{"record":{"id":"6d899036c7697757","repo":"tonhowtf/omniget","slug":"binario-sumiu-apos-instalar","errorCode":null,"errorMessage":"binario sumiu apos instalar","messagePattern":"binario sumiu apos instalar","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/upscale.rs","lineNumber":101,"sourceCode":"    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\")]\n    pub format: String,\n    #[serde(default)]\n    pub output_dir: String,\n    #[serde(default)]\n    pub tile_size: u32,\n}\n","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/upscale.rs#L83-L119","documentation":"After swapping the staging directory into place, install() calls locate() to confirm the Real-ESRGAN binary is discoverable. If locate() returns None even though installation just completed, it throws 'binario sumiu apos instalar' — an internal invariant: the binary disappeared or is not where expected after install.","triggerScenarios":"swap_dir succeeded but locate() cannot find the binary: permissions stripped, PATH/cache used by locate() not refreshed, or the swap moved files to an unexpected location.","commonSituations":"Antivirus or quarantine removing the executable immediately after write; locate() checking a different (stale) directory; filesystem sync issues on network mounts; macOS Gatekeeper deletion of unsigned binaries.","solutions":["Re-run install and then locate() manually to see where the binary landed","Check antivirus/quarantine logs — the binary may be deleted right after extraction","Verify swap_dir moved the staging dir to the path locate() searches","Clear any cached path index used by locate() so it re-scans the managed dir"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"fn verify_installed() -> bool {\n    locate().is_some()\n}\nif !verify_installed() {\n    upscale::install(&progress).await?;\n}","typeGuard":null,"tryCatchPattern":"match upscale::install(&progress).await {\n    Err(e) if e.to_string().contains(\"binario sumiu\") => {\n        // likely antivirus/quarantine; alert user and retry\n        warn_user(\"Binário removido após instalação — verifique o antivírus\");\n    }\n    other => other,\n}","preventionTips":["Whitelist the managed tools directory in antivirus software","Keep locate()'s search path in sync with swap_dir's target","Re-scan the managed dir (no caching) right after install"],"tags":["installation","filesystem","invariant","rust"],"backgroundTag":"internal-invariant-violation","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}