Devolutions/UniGetUI · error · InvalidOperationException
The manager parameter is required.
Error message
The manager parameter is required.
What it means
Thrown by ResolveManager (singular) when managerName is null, empty, or whitespace. Unlike ResolveManagers (plural) which accepts null as 'match all', ResolveManager requires a specific manager because it returns exactly one IPackageManager via .First().
Source
Thrown at src/UniGetUI.Interface.IpcApi/IpcManagerSettingsApi.cs:354
.ToArray();
if (managers.Length == 0)
{
throw new InvalidOperationException(
string.IsNullOrWhiteSpace(managerName)
? "No package managers are available."
: $"No package manager matching \"{managerName}\" was found."
);
}
return managers;
}
internal static IPackageManager ResolveManager(string managerName)
{
if (string.IsNullOrWhiteSpace(managerName))
{
throw new InvalidOperationException("The manager parameter is required.");
}
return ResolveManagers(managerName).First();
}
internal static bool MatchesManagerId(IPackageManager manager, string? managerName)
{
return string.IsNullOrWhiteSpace(managerName)
|| manager.Id.Equals(managerName, StringComparison.OrdinalIgnoreCase);
}
internal static string GetPublicManagerId(IPackageManager manager)
{
return manager.Id;
}
internal static string GetPublicManagerId(string? managerName)
{View on GitHub (pinned to 9b1d7d0eab)
Solutions
- Provide a non-empty manager name (preferably the manager Id) to the request.
- Call ListManagers() to get valid manager Ids before calling single-manager APIs.
- Add client-side validation that managerName is not blank before sending the IPC request.
Example fix
// before
var info = IpcManagerMaintenanceApi.GetMaintenanceInfo("");
// after
var managers = IpcManagerSettingsApi.ListManagers();
if (managers.Count == 0) throw new InvalidOperationException("No managers.");
var info = IpcManagerMaintenanceApi.GetMaintenanceInfo(managers[0].Name); Defensive patterns
Strategy: validation
Validate before calling
if (string.IsNullOrWhiteSpace(managerName))
throw new ArgumentException("Manager name is required.", nameof(managerName)); Prevention
- Always validate managerName is non-blank before calling single-manager APIs.
- Remember ResolveManager (singular) requires a name, while ResolveManagers (plural) accepts null.
- Populate ManagerName on request DTOs explicitly — they default to empty string.
When it happens
Trigger: Calling GetMaintenanceInfo(null), AddSourceAsync/RemoveSourceAsync with an empty ManagerName, SetManagerEnabledAsync/SetManagerNotifications with empty ManagerName, or any API that calls ResolveManager with a null/whitespace argument.
Common situations: IPC client omits the managerName field from the JSON payload (defaults to empty string via DTO initialization). Form validation missing on the client side. Using the plural ResolveManagers API where null means 'all' and accidentally routing to the singular resolver.
Related errors
- {expectedName} maintenance actions can only run against the
- No package managers are available.
- No package manager matching "{managerName}" was found.
- The source name is required.
- The setting key is required.
AI-assisted analysis of Devolutions/UniGetUI@9b1d7d0eab (2026-08-13).
Data as JSON: /api/errors/3826ebee0fcc4feb.
Report an issue: GitHub.