Devolutions/UniGetUI · error · InvalidOperationException

The outputPath parameter is required when downloading a pack

Error message

The outputPath parameter is required when downloading a package.

What it means

DownloadPackageAsync throws when request.OutputPath is null, empty, or whitespace. Downloading a package requires an explicit destination path that DownloadOperation writes to.

Source

Thrown at src/UniGetUI.Interface.IpcApi/IpcPackageApi.cs:209

        var package = FindInstalledPackage(request);
        return ExecuteOperationAsync(
            "uninstall-package",
            package,
            request,
            (pkg, options) => new UninstallPackageOperation(pkg, options)
        );
    }

    public static async Task<IpcPackageOperationResult> DownloadPackageAsync(
        IpcPackageActionRequest request
    )
    {
        ArgumentNullException.ThrowIfNull(request);

        if (string.IsNullOrWhiteSpace(request.OutputPath))
        {
            throw new InvalidOperationException(
                "The outputPath parameter is required when downloading a package."
            );
        }

        var package = FindAnyPackage(request);
        if (!package.Manager.Capabilities.CanDownloadInstaller)
        {
            throw new InvalidOperationException(
                $"The manager \"{IpcManagerSettingsApi.GetPublicManagerId(package.Manager)}\" does not support installer downloads."
            );
        }

        var operation = new DownloadOperation(package, request.OutputPath);
        string operationId = IpcOperationApi.Track(operation);

        if (request.WaitForCompletion == false)
        {
            _ = Task.Run(() => RunTrackedOperationAsync(operation));

View on GitHub (pinned to 9b1d7d0eab)

Solutions

  1. Set request.OutputPath to an absolute, writable path before calling
  2. Validate the path is non-empty and the parent directory exists client-side
  3. Use a path under a temp/exports folder the process can write

Example fix

// before
var req = new IpcPackageActionRequest { PackageId = "git" };
await IpcPackageApi.DownloadPackageAsync(req);
// after
var req = new IpcPackageActionRequest
{
    PackageId = "git",
    OutputPath = Path.Combine(exportsDir, "git.installer.exe")
};
await IpcPackageApi.DownloadPackageAsync(req);
Defensive patterns

Strategy: validation

Validate before calling

if (string.IsNullOrWhiteSpace(request.OutputPath)
    || !Path.IsPathRooted(request.OutputPath))
    throw new ArgumentException("OutputPath must be an absolute path");

Prevention

When it happens

Trigger: Calling download-package with the outputPath field omitted or blank in the request body.

Common situations: Client JSON missing the field; serializer defaulted OutputPath to ""; UI submitted before a path was chosen.

Related errors


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