Devolutions/UniGetUI · error · InvalidOperationException
The manager action "{action}" requires confirm=true.
Error message
The manager action "{action}" requires confirm=true. What it means
Thrown by EnsureConfirmed when request.Confirm is false (the default for bool). The four destructive maintenance actions — repair-winget, install-scoop, uninstall-scoop, and cleanup-scoop — all call EnsureConfirmed as their first guard to require an explicit opt-in. This is a safety interlock to prevent accidental system-level changes.
Source
Thrown at src/UniGetUI.Interface.IpcApi/IpcManagerMaintenanceApi.cs:346
Verb = runAsAdmin ? "runas" : string.Empty,
CreateNoWindow = !runAsAdmin,
},
};
process.Start();
await process.WaitForExitAsync();
if (process.ExitCode != 0)
{
throw new InvalidOperationException(
$"The maintenance command exited with code {process.ExitCode}."
);
}
}
private static void EnsureConfirmed(IpcManagerMaintenanceRequest request, string action)
{
if (!request.Confirm)
{
throw new InvalidOperationException(
$"The manager action \"{action}\" requires confirm=true."
);
}
}
private static void EnsureManager(IPackageManager manager, string expectedName)
{
if (!manager.Name.Equals(expectedName, StringComparison.OrdinalIgnoreCase))
{
throw new InvalidOperationException(
$"{expectedName} maintenance actions can only run against the {expectedName} manager."
);
}
}
private static void EnsureWindowsOnly(string action)
{
if (!OperatingSystem.IsWindows())View on GitHub (pinned to 9b1d7d0eab)
Solutions
- Set Confirm=true on the request object before calling RunActionAsync for any of the four destructive actions.
- Check GetMaintenanceInfo().SupportedActions to see which actions require confirmation before calling.
- For the 'reload' action, no Confirm is needed — it does not call EnsureConfirmed.
Example fix
// before
var req = new IpcManagerMaintenanceRequest {
ManagerName = "Scoop",
Action = "install-scoop"
};
// after
var req = new IpcManagerMaintenanceRequest {
ManagerName = "Scoop",
Action = "install-scoop",
Confirm = true
}; Defensive patterns
Strategy: validation
Validate before calling
static bool RequiresConfirmation(string action) =>
action is "repair-winget" or "install-scoop" or "uninstall-scoop" or "cleanup-scoop";
// Before calling:
if (RequiresConfirmation(request.Action!) && !request.Confirm)
throw new ArgumentException("Set Confirm=true for destructive actions."); Prevention
- Always set Confirm=true explicitly for destructive maintenance actions.
- Create a factory method that defaults Confirm based on the action type.
- Remember that bool defaults to false — omitting Confirm is the same as Confirm=false.
When it happens
Trigger: Calling RunActionAsync with action set to 'repair-winget', 'install-scoop', 'uninstall-scoop', or 'cleanup-scoop' but omitting Confirm=true (or explicitly setting Confirm=false) on the IpcManagerMaintenanceRequest.
Common situations: Developer forgets that the IpcManagerMaintenanceRequest DTO initializes Confirm to false. An IPC client serializes the request and omits the confirm field, which deserializes to false. Integration test harnesses that construct the DTO without setting Confirm.
Related errors
- {expectedName} maintenance actions can only run against the
- The manager action "{action}" is only supported on Windows.
- Unsupported page \"{page}\". Supported pages: {string.Join("
- The cloud backup \"{key}\" was not found.
- The backup key is required.
AI-assisted analysis of Devolutions/UniGetUI@9b1d7d0eab (2026-08-13).
Data as JSON: /api/errors/54136efa5fe5f11a.
Report an issue: GitHub.