{"record":{"id":"24d2e5efa238c6f4","repo":"Devolutions/UniGetUI","slug":"the-manager-action-action-is-only-supported-on","errorCode":null,"errorMessage":"The manager action \"{action}\" is only supported on Windows.","messagePattern":"The manager action \"(.+?)\" is only supported on Windows\\.","errorType":"validation","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/UniGetUI.Interface.IpcApi/IpcManagerMaintenanceApi.cs","lineNumber":366,"sourceCode":"            );\n        }\n    }\n\n    private static void EnsureManager(IPackageManager manager, string expectedName)\n    {\n        if (!manager.Name.Equals(expectedName, StringComparison.OrdinalIgnoreCase))\n        {\n            throw new InvalidOperationException(\n                $\"{expectedName} maintenance actions can only run against the {expectedName} manager.\"\n            );\n        }\n    }\n\n    private static void EnsureWindowsOnly(string action)\n    {\n        if (!OperatingSystem.IsWindows())\n        {\n            throw new InvalidOperationException(\n                $\"The manager action \\\"{action}\\\" is only supported on Windows.\"\n            );\n        }\n    }\n\n    private static IpcManagerMaintenanceActionResult Success(\n        string command,\n        IPackageManager manager,\n        string action,\n        string operationStatus,\n        string? message = null\n    )\n    {\n        return new IpcManagerMaintenanceActionResult\n        {\n            Status = \"success\",\n            Command = command,\n            Manager = IpcManagerSettingsApi.GetPublicManagerId(manager),","sourceCodeStart":348,"sourceCodeEnd":384,"githubUrl":"https://github.com/Devolutions/UniGetUI/blob/9b1d7d0eab91620fc15c86b36676532095936ae3/src/UniGetUI.Interface.IpcApi/IpcManagerMaintenanceApi.cs#L348-L384","documentation":"Thrown by EnsureWindowsOnly when OperatingSystem.IsWindows() returns false. All four destructive maintenance actions (repair-winget, install-scoop, uninstall-scoop, cleanup-scoop) call EnsureWindowsOnly because they shell out to PowerShell 5 (cmd.exe-based scripts, AppxPackage cmdlets, UAC elevation) that only exist on Windows.","triggerScenarios":"Running UniGetUI on Linux, macOS, or WSL and calling RunActionAsync with any of the four Windows-only actions. The 'reload' action does not call EnsureWindowsOnly and works cross-platform.","commonSituations":"Cross-platform Avalonia build running on Linux for development/testing. CI pipeline running on a Linux runner that exercises IPC endpoints. The action switch case fires before the guard, but EnsureWindowsOnly is called inside each case (after EnsureConfirmed and EnsureManager).","solutions":["Only call Windows-only actions on Windows — gate with OperatingSystem.IsWindows() in the caller.","Use GetMaintenanceInfo().SupportedActions to check available actions before calling; the list is only populated with Windows-only actions if on Windows (though note the current code adds them unconditionally in ToMaintenanceInfo).","For non-Windows platforms, only use the 'reload' action which has no platform guard."],"exampleFix":"// before — unguarded cross-platform call\nawait IpcManagerMaintenanceApi.RunActionAsync(req);\n// after\nif (!OperatingSystem.IsWindows())\n    throw new PlatformNotSupportedException(\"Scoop actions require Windows.\");\nawait IpcManagerMaintenanceApi.RunActionAsync(req);","handlingStrategy":"validation","validationCode":"static readonly HashSet<string> WindowsOnlyActions = new()\n{\n    \"repair-winget\", \"install-scoop\", \"uninstall-scoop\", \"cleanup-scoop\"\n};\n\nif (WindowsOnlyActions.Contains(request.Action!) && !OperatingSystem.IsWindows())\n    throw new PlatformNotSupportedException($\"{request.Action} requires Windows.\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Gate Windows-only maintenance actions behind OperatingSystem.IsWindows() in the caller.","On non-Windows platforms, only use the 'reload' action which has no platform guard.","Remember the guard fires after EnsureConfirmed and EnsureManager — order matters."],"tags":["maintenance","ipc","platform","windows","validation"],"backgroundTag":null,"analyzedSha":"9b1d7d0eab91620fc15c86b36676532095936ae3","analyzedAt":"2026-08-13T12:19:18.278Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}