{"record":{"id":"9af393db645dbdba","repo":"Devolutions/UniGetUI","slug":"no-installed-package-matching-id-packageid-was","errorCode":null,"errorMessage":"No installed package matching id \"{PackageId}\" was found.","messagePattern":"No installed package matching id \"(.+?)\" was found\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":400,"severity":"warning","filePath":"src/UniGetUI.Interface.IpcApi/IpcPackageApi.cs","lineNumber":626,"sourceCode":"    }\n\n    private static IPackage FindAnyPackage(IpcPackageActionRequest request)\n    {\n        return TryFindPackageForStateMutation(request)\n            ?? FindSearchResult(request);\n    }\n\n    private static IPackage FindInstalledPackage(IpcPackageActionRequest request)\n    {\n        var package = GetInstalledPackagesSnapshot(request.ManagerName).FirstOrDefault(candidate =>\n            MatchesIdentity(candidate, request)\n        );\n        if (package is not null)\n        {\n            return package;\n        }\n\n        throw new InvalidOperationException(\n            $\"No installed package matching id \\\"{request.PackageId}\\\" was found.\"\n        );\n    }\n\n    private static IPackage FindUpgradablePackage(IpcPackageActionRequest request)\n    {\n        var package = GetUpgradablePackagesSnapshot(request.ManagerName).FirstOrDefault(candidate =>\n            MatchesIdentity(candidate, request)\n        );\n        if (package is not null)\n        {\n            return package;\n        }\n\n        throw new InvalidOperationException(\n            $\"No upgradable package matching id \\\"{request.PackageId}\\\" was found.\"\n        );\n    }","sourceCodeStart":608,"sourceCodeEnd":644,"githubUrl":"https://github.com/Devolutions/UniGetUI/blob/9b1d7d0eab91620fc15c86b36676532095936ae3/src/UniGetUI.Interface.IpcApi/IpcPackageApi.cs#L608-L644","documentation":"FindInstalledPackage throws when the installed-packages snapshot (loader cache, else a live manager query) contains no package matching the id. Used by uninstall and reinstall.","triggerScenarios":"Calling uninstall/reinstall on a package that is not installed under any matching manager.","commonSituations":"Stale client list; package already removed by another path; the installed loader has not finished loading yet.","solutions":["Refresh the installed snapshot before acting","Source the exact id/source pair from the installed list the UI already has","Pre-check the snapshot with a FindInstalledPackage-style lookup"],"exampleFix":"// before\nawait IpcPackageApi.UninstallPackageAsync(staleRequest);\n// after\nvar installed = manager.GetInstalledPackages()\n    .FirstOrDefault(p => p.Id == request.PackageId);\nif (installed is null) return Result.NotFound(\"not installed\");\nawait IpcPackageApi.UninstallPackageAsync(ToRequest(installed));","handlingStrategy":"validation","validationCode":"// Confirm the package is in the installed snapshot before uninstall\nvar present = GetInstalledPackagesSnapshot(request.ManagerName)\n    .Any(p => MatchesIdentity(p, request));\nif (!present) return Result.NotFound(\"not installed\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Wait for the installed loader to finish before offering uninstall","Refresh snapshots after bulk operations"],"tags":["ipc","package-lookup","installed"],"backgroundTag":null,"analyzedSha":"9b1d7d0eab91620fc15c86b36676532095936ae3","analyzedAt":"2026-08-13T12:19:18.278Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}