{"record":{"id":"e314d954894ffef9","repo":"Devolutions/UniGetUI","slug":"the-current-unigetui-session-cannot-open-package-d","errorCode":null,"errorMessage":"The current UniGetUI session cannot open package details.","messagePattern":"The current UniGetUI session cannot open package details\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":400,"severity":"warning","filePath":"src/UniGetUI.Interface.IpcApi/IpcServer.cs","lineNumber":1574,"sourceCode":"            if (!AuthenticateToken(context.Request.Query[\"token\"]))\n            {\n                context.Response.StatusCode = 401;\n                return;\n            }\n\n            string packageId = context.Request.Query[\"packageId\"].ToString();\n            if (string.IsNullOrWhiteSpace(packageId))\n            {\n                context.Response.StatusCode = 400;\n                await context.Response.WriteAsync(\"The packageId parameter is required.\");\n                return;\n            }\n\n            try\n            {\n                await context.Response.WriteAsJsonAsync(\n                    ShowPackageHandler?.Invoke(BuildPackageActionRequest(context.Request))\n                        ?? throw new InvalidOperationException(\n                            \"The current UniGetUI session cannot open package details.\"\n                        ),\n                    IpcJson.Options\n                );\n            }\n            catch (InvalidOperationException ex)\n            {\n                context.Response.StatusCode = 400;\n                await context.Response.WriteAsync(ex.Message);\n            }\n        }\n\n        private async Task V3_UpdateAllPackages(HttpContext context)\n        {\n            await HandleCommandAsync(\n                context,\n                () =>\n                {","sourceCodeStart":1556,"sourceCodeEnd":1592,"githubUrl":"https://github.com/Devolutions/UniGetUI/blob/9b1d7d0eab91620fc15c86b36676532095936ae3/src/UniGetUI.Interface.IpcApi/IpcServer.cs#L1556-L1592","documentation":"V3_ShowPackage throws when ShowPackageHandler is null: the session cannot open a package-details window. Notably, HeadlessIpcHost does NOT register ShowPackageHandler, so this fires for any show-package call against a headless/background session.","triggerScenarios":"Calling show-package (open package details) against a headless session, or any host that did not wire ShowPackageHandler.","commonSituations":"Automation client assumes a GUI is present; deployment runs the headless host but the client issues a details-open command.","solutions":["Gate the show-package call on IpcAppInfo.Headless == false (and a capability flag)","Only call show-package from GUI-attached sessions","In headless hosts, return a clean 'unsupported' rather than issuing the call"],"exampleFix":"// before\nawait ShowPackageAsync(req); // against headless host\n// after\nvar info = await GetAppInfoAsync();\nif (info.Headless) return Result.Unsupported(\"no UI in headless mode\");\nawait ShowPackageAsync(req);","handlingStrategy":"validation","validationCode":"var info = await GetAppInfoAsync();\nif (info.Headless || info.WindowAvailable == false)\n    return Result.Unsupported(\"package details require a GUI session\");\nawait ShowPackageAsync(req);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Detect headless mode from app-info before UI-only commands","Register ShowPackageHandler only in GUI-capable hosts"],"tags":["ipc","package-details","capability","headless"],"backgroundTag":null,"analyzedSha":"9b1d7d0eab91620fc15c86b36676532095936ae3","analyzedAt":"2026-08-13T12:19:18.278Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}