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
- Provide the full shortcut file path in the Path field.
- If building the body programmatically, assert the path is non-empty before sending.
- 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
- Require a non-empty path in the request DTO via a model validator.
- Guard shell-quoting helpers that may collapse values to quotes.
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
- This command requires {argumentName} with a value of true or
- The status parameter must be either keep or delete.
- The path field is required.
- The action field is required.
- Bundle export only supports .ubundle and .json output files.
AI-assisted analysis of Devolutions/UniGetUI@9b1d7d0eab (2026-08-13).
Data as JSON: /api/errors/0656004a53a54340.
Report an issue: GitHub.