{"record":{"id":"b24b2cbce246493e","repo":"CloakHQ/CloakBrowser","slug":"pro-download-completed-but-binary-not-found-at-p-b24b2c","errorCode":null,"errorMessage":"Pro download completed but binary not found at: {p}","messagePattern":"Pro download completed but binary not found at: (.+?)","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"dotnet/src/CloakBrowser/Download.cs","lineNumber":1240,"sourceCode":"        string licenseKey, CancellationToken ct = default, string? releaseChannel = null)\n    {\n        var latest = License.GetProLatestVersion(releaseChannel);\n        if (string.IsNullOrEmpty(latest)) return null;\n\n        var effective = Config.GetEffectiveVersion(pro: true, releaseChannel: releaseChannel);\n        if (effective != null && !Config.VersionNewer(latest, effective) && ProBinaryReady(effective))\n        {\n            // Already on the latest cached Pro build.\n            return null;\n        }\n\n        if (!ProBinaryReady(latest))\n        {\n            CloakLog.Info(\"Downloading Pro Chromium {0}...\", latest);\n            await DownloadProBinaryAsync(latest, licenseKey, ct).ConfigureAwait(false);\n            var p = Config.GetBinaryPath(latest, pro: true);\n            if (!File.Exists(p))\n                throw new InvalidOperationException($\"Pro download completed but binary not found at: {p}\");\n        }\n\n        WriteProVersionMarker(latest, releaseChannel);\n        return latest;\n    }\n\n    /// <summary>Synchronous convenience wrapper around <see cref=\"CheckForProUpdateAsync\"/>.</summary>\n    public static string? CheckForProUpdate(string licenseKey, string? releaseChannel = null) =>\n        CheckForProUpdateAsync(licenseKey, releaseChannel: releaseChannel).GetAwaiter().GetResult();\n\n    private static bool ShouldCheckForUpdate()\n    {\n        if ((Environment.GetEnvironmentVariable(\"CLOAKBROWSER_AUTO_UPDATE\") ?? \"\").ToLowerInvariant() == \"false\")\n            return false;\n        if (Config.GetLocalBinaryOverride() != null) return false;\n        if (Environment.GetEnvironmentVariable(\"CLOAKBROWSER_DOWNLOAD_URL\") != null) return false;\n\n        var checkFile = Path.Combine(Config.GetCacheDir(), \".last_update_check\");","sourceCodeStart":1222,"sourceCodeEnd":1258,"githubUrl":"https://github.com/CloakHQ/CloakBrowser/blob/d6bad5de261bedf025280ace1d14e800aee13923/dotnet/src/CloakBrowser/Download.cs#L1222-L1258","documentation":"Thrown after the Pro Chromium download routine reports success but the expected binary path does not exist on disk. It indicates the download/extraction pipeline silently failed or extracted to an unexpected location. The library treats it as a hard integrity check on the managed Pro binary.","triggerScenarios":"Calling the Pro-version ensure/download flow (Download with a license key for the Pro channel) when DownloadProBinaryAsync completes without exception but Config.GetBinaryPath(latest, pro: true) points to a missing file — e.g. archive extracted into a subdirectory, disk full, antivirus quarantine, or a mismatched version string used for the path.","commonSituations":"Antivirus/EDR removing the downloaded Chromium binary; insufficient disk space during extraction; changed archive layout in a new Pro release; stale Config.GetBinaryPath mapping after upgrading the package; read-only cache directory.","solutions":["Manually clear the browser cache/download directory and retry so a fresh archive is downloaded and extracted.","Check disk space and write permissions on the directory returned by Config.GetBinaryPath.","Verify antivirus/quarantine exclusions for the browser cache directory, then retry.","Inspect the downloaded archive layout and confirm Config.GetBinaryPath computes the same path the extractor writes to; report a bug if they diverge."],"exampleFix":"// before\nawait DownloadProBinaryAsync(latest, licenseKey, ct);\nvar p = Config.GetBinaryPath(latest, pro: true);\nif (!File.Exists(p)) throw new InvalidOperationException($\"Pro download completed but binary not found at: {p}\");\n\n// after (defensive caller: pre-check and self-heal)\nvar p = Config.GetBinaryPath(latest, pro: true);\nif (!File.Exists(p))\n{\n    Directory.Delete(Path.GetDirectoryName(p)!, recursive: true); // clear partial state\n    await DownloadAsync(clearCache: true, ct);                    // re-download\n}\np = Config.GetBinaryPath(latest, pro: true);\nFile.Exists(p).Should().BeTrue();","handlingStrategy":"validation","validationCode":"var p = Config.GetBinaryPath(latestVersion, pro: true);\nif (!File.Exists(p))\n{\n    await browser.Download.ClearCacheAsync(); // remove partial state\n    await browser.Download.DownloadAsync(clearCache: true);\n}","typeGuard":null,"tryCatchPattern":"catch (InvalidOperationException ex) when (ex.Message.StartsWith(\"Pro download completed but binary not found\"))\n{\n    await browser.Download.ClearCacheAsync();\n    await browser.Download.DownloadAsync(clearCache: true); // retry once\n}","preventionTips":["Keep the browser cache directory writable and on a disk with ample free space.","Add antivirus exclusions for the browser cache directory.","Check File.Exists on the binary path before launching after any download."],"tags":["download","chromium","pro","filesystem","integrity-check"],"backgroundTag":"downloaded-file-missing","analyzedSha":"d6bad5de261bedf025280ace1d14e800aee13923","analyzedAt":"2026-08-28T14:13:12.918Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}