Devolutions/UniGetUI · error · InvalidOperationException

The path parameter is required.

Error message

The path parameter is required.

What it means

Thrown by IpcDesktopShortcutsApi.NormalizeShortcutPath when, after trimming whitespace and surrounding quotes/apostrophes, the path is empty. NormalizeShortcutPath is the shared guard for SetShortcut and ResetShortcut, so both endpoints reject a blank path.

Source

Thrown at src/UniGetUI.Interface.IpcApi/IpcDesktopShortcutsApi.cs:129

                : System.IO.Path.GetFileNameWithoutExtension(fileName),
            Status = DesktopShortcutsDatabase.GetStatus(shortcutPath) switch
            {
                DesktopShortcutsDatabase.Status.Delete => "delete",
                DesktopShortcutsDatabase.Status.Maintain => "keep",
                _ => "unknown",
            },
            ExistsOnDisk = File.Exists(shortcutPath),
            IsTracked = trackedShortcuts.ContainsKey(shortcutPath),
            IsPendingReview = DesktopShortcutsDatabase.GetUnknownShortcuts().Contains(shortcutPath),
        };
    }

    private static string NormalizeShortcutPath(string shortcutPath)
    {
        string normalizedPath = shortcutPath.Trim().Trim('"').Trim('\'');
        if (string.IsNullOrWhiteSpace(normalizedPath))
        {
            throw new InvalidOperationException("The path parameter is required.");
        }

        return normalizedPath;
    }
}

View on GitHub (pinned to 9b1d7d0eab)

Solutions

  1. Provide the full shortcut file path in the Path field.
  2. If building the body programmatically, assert the path is non-empty before sending.
  3. Ensure shell quoting does not collapse the path to empty quotes.

Example fix

// before
{ "path": "\"\"", "status": "delete" }
// after
{ "path": "C:/Users/me/Desktop/App.lnk", "status": "delete" }
Defensive patterns

Strategy: validation

Validate before calling

static bool HasShortcutPath(string? p)
{
    var norm = p?.Trim().Trim('"').Trim('\'').Trim();
    return !string.IsNullOrWhiteSpace(norm);
}

Prevention

When it happens

Trigger: Calling set-desktop-shortcut or reset-desktop-shortcut with a Path that is empty, only whitespace, or only quote characters. The normalizer strips \\", \\', and whitespace before the emptiness check.

Common situations: Omitting the path field in the JSON body. Passing a value that consisted only of stray quotes from a shell. A templating bug producing an empty path.

Related errors


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