Devolutions/UniGetUI · warning · InvalidOperationException

The current UniGetUI session cannot open package details.

Error message

The current UniGetUI session cannot open package details.

What it means

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.

Source

Thrown at src/UniGetUI.Interface.IpcApi/IpcServer.cs:1574

            if (!AuthenticateToken(context.Request.Query["token"]))
            {
                context.Response.StatusCode = 401;
                return;
            }

            string packageId = context.Request.Query["packageId"].ToString();
            if (string.IsNullOrWhiteSpace(packageId))
            {
                context.Response.StatusCode = 400;
                await context.Response.WriteAsync("The packageId parameter is required.");
                return;
            }

            try
            {
                await context.Response.WriteAsJsonAsync(
                    ShowPackageHandler?.Invoke(BuildPackageActionRequest(context.Request))
                        ?? throw new InvalidOperationException(
                            "The current UniGetUI session cannot open package details."
                        ),
                    IpcJson.Options
                );
            }
            catch (InvalidOperationException ex)
            {
                context.Response.StatusCode = 400;
                await context.Response.WriteAsync(ex.Message);
            }
        }

        private async Task V3_UpdateAllPackages(HttpContext context)
        {
            await HandleCommandAsync(
                context,
                () =>
                {

View on GitHub (pinned to 9b1d7d0eab)

Solutions

  1. Gate the show-package call on IpcAppInfo.Headless == false (and a capability flag)
  2. Only call show-package from GUI-attached sessions
  3. In headless hosts, return a clean 'unsupported' rather than issuing the call

Example fix

// before
await ShowPackageAsync(req); // against headless host
// after
var info = await GetAppInfoAsync();
if (info.Headless) return Result.Unsupported("no UI in headless mode");
await ShowPackageAsync(req);
Defensive patterns

Strategy: validation

Validate before calling

var info = await GetAppInfoAsync();
if (info.Headless || info.WindowAvailable == false)
    return Result.Unsupported("package details require a GUI session");
await ShowPackageAsync(req);

Prevention

When it happens

Trigger: Calling show-package (open package details) against a headless session, or any host that did not wire ShowPackageHandler.

Common situations: Automation client assumes a GUI is present; deployment runs the headless host but the client issues a details-open command.

Related errors


AI-assisted analysis of Devolutions/UniGetUI@9b1d7d0eab (2026-08-13). Data as JSON: /api/errors/e314d954894ffef9. Report an issue: GitHub.