{"record":{"id":"ad13621cab0857f5","repo":"Devolutions/UniGetUI","slug":"the-current-unigetui-session-cannot-update-manager","errorCode":null,"errorMessage":"The current UniGetUI session cannot update manager packages.","messagePattern":"The current UniGetUI session cannot update manager packages\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":400,"severity":"error","filePath":"src/UniGetUI.Interface.IpcApi/IpcServer.cs","lineNumber":1614,"sourceCode":"                            \"The current UniGetUI session cannot update all packages.\"\n                        );\n                    }\n\n                    OnUpgradeAll.Invoke(null, EventArgs.Empty);\n                    return IpcCommandResult.Success(\"update-all\");\n                }\n            );\n        }\n\n        private async Task V3_UpdateAllPackagesForManager(HttpContext context)\n        {\n            await HandleCommandAsync(\n                context,\n                () =>\n                {\n                    if (OnUpgradeAllForManager is null)\n                    {\n                        throw new InvalidOperationException(\n                            \"The current UniGetUI session cannot update manager packages.\"\n                        );\n                    }\n\n                    string managerName = GetRequiredQueryValue(context, \"manager\");\n                    OnUpgradeAllForManager.Invoke(null, managerName);\n                    return IpcCommandResult.Success(\"update-manager\");\n                }\n            );\n        }\n\n        private static async Task HandlePackageActionAsync(\n            HttpContext context,\n            Func<IpcPackageActionRequest, Task<IpcPackageOperationResult>> action\n        )\n        {\n            if (!AuthenticateToken(context.Request.Query[\"token\"]))\n            {","sourceCodeStart":1596,"sourceCodeEnd":1632,"githubUrl":"https://github.com/Devolutions/UniGetUI/blob/9b1d7d0eab91620fc15c86b36676532095936ae3/src/UniGetUI.Interface.IpcApi/IpcServer.cs#L1596-L1632","documentation":"Thrown by the IPC v3 per-manager update endpoint when OnUpgradeAllForManager is null. It mirrors error 80 but targets a single package manager (the 'manager' query selects which). HandleCommandAsync converts it to HTTP 400.","triggerScenarios":"Calling V3_UpdateAllPackagesForManager (with ?manager=<name>) while OnUpgradeAllForManager has no subscriber, or the manager name is valid but the session did not wire per-manager upgrades.","commonSituations":"Standalone/automated IPC use without the GUI host; invoking the endpoint during startup race before subscription; the target manager failed to initialize so the handler was never attached.","solutions":["Subscribe to OnUpgradeAllForManager in the host before starting the listener: ipcServer.OnUpgradeAllForManager += (_, name) => PMManager.UpgradeAllPackagesForManager(name);","Verify the requested manager loaded successfully (PMPEngagement) before exposing its endpoint.","As a caller, branch on the 400 body: 'session cannot update manager packages' is not retryable without restarting/re-wiring the host."],"exampleFix":"// before: OnUpgradeAllForManager null -> HTTP 400\n// after:\nipcServer.OnUpgradeAllForManager += (_, managerName) =>\n    PMManager.GetManager(managerName)?.UpgradeAllPackages();","handlingStrategy":"validation","validationCode":"// Client: detect the unavailable-per-manager response.\nvar body = await response.Content.ReadAsStringAsync();\nif (response.StatusCode == HttpStatusCode.BadRequest &&\n    body == \"The current UniGetUI session cannot update manager packages.\")\n    return Result.Unavailable(managerName);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Wire OnUpgradeAllForManager before starting the IPC listener.","Confirm the target manager loaded (PMManager.GetManager(name) != null) before exposing the endpoint.","Surface this 400 as 'operation not supported' to the user, not as a transient retry."],"tags":["ipc","http-400","event-not-wired","per-manager"],"backgroundTag":null,"analyzedSha":"9b1d7d0eab91620fc15c86b36676532095936ae3","analyzedAt":"2026-08-13T12:19:18.278Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}