{"record":{"id":"7592bdb044b1bc26","repo":"Devolutions/UniGetUI","slug":"retry-mode-retrymode-is-not-supported-for-oper","errorCode":null,"errorMessage":"Retry mode \"{retryMode}\" is not supported for operation {operationId}.","messagePattern":"Retry mode \"(.+?)\" is not supported for operation (.+?)\\.","errorType":"validation","errorClass":"InvalidOperationException","httpStatus":null,"severity":"warning","filePath":"src/UniGetUI.Interface.IpcApi/IpcOperationApi.cs","lineNumber":224,"sourceCode":"        tracked.Operation.Cancel();\n        return IpcCommandResult.Success(\"cancel-operation\");\n    }\n\n    public static IpcCommandResult RetryOperation(string operationId, string? retryMode)\n    {\n        var tracked = GetTrackedOperation(operationId);\n        if (IsActive(tracked.Operation.Status))\n        {\n            throw new InvalidOperationException(\n                \"Running or queued operations cannot be retried.\"\n            );\n        }\n\n        string normalizedRetryMode = NormalizeRetryMode(retryMode);\n        var availableRetryModes = GetRetryModes(tracked.Operation);\n        if (!availableRetryModes.Contains(ToRetryModeName(normalizedRetryMode)))\n        {\n            throw new InvalidOperationException(\n                $\"Retry mode \\\"{retryMode}\\\" is not supported for operation {operationId}.\"\n            );\n        }\n\n        tracked.Operation.Retry(normalizedRetryMode);\n        return IpcCommandResult.Success(\"retry-operation\");\n    }\n\n    public static IpcCommandResult ReorderOperation(string operationId, string action)\n    {\n        var tracked = GetTrackedOperation(operationId);\n        if (tracked.Operation.Status != OperationStatus.InQueue)\n        {\n            throw new InvalidOperationException(\n                \"Only queued operations can be reordered.\"\n            );\n        }\n","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/Devolutions/UniGetUI/blob/9b1d7d0eab91620fc15c86b36676532095936ae3/src/UniGetUI.Interface.IpcApi/IpcOperationApi.cs#L206-L242","documentation":"Thrown by RetryOperation when the provided retryMode is valid syntactically but not applicable to the operation type. After NormalizeRetryMode converts the input to an internal mode string, GetRetryModes computes the set of valid modes for the operation. If the requested mode isn't in that set, this error fires. For example, 'retry-as-admin' is only available if the operation didn't already use admin and the manager supports it.","triggerScenarios":"Calling RetryOperation with a retryMode that is not in GetRetryModes(tracked.Operation). For PackageOperations, 'retry-as-admin' requires !Options.RunAsAdministrator AND manager.Capabilities.CanRunAsAdmin. 'retry-interactive' requires !Options.InteractiveInstallation AND CanRunInteractively. 'retry-no-hash-check' requires !Options.SkipHashCheck AND CanSkipIntegrityChecks. For SourceOperations, 'retry-as-admin' requires !ForceAsAdministrator.","commonSituations":"Requesting 'retry-as-admin' when the operation already ran as admin. Requesting 'retry-interactive' for a manager that doesn't support interactive mode (e.g., Pip). Requesting a retry mode for an operation type that doesn't support it (e.g., source operation with 'retry-interactive'). The capabilities flags on the manager gate which modes are available.","solutions":["Check AvailableRetryModes from GetOperation/ListOperations before calling RetryOperation.","Start with 'retry' (always available for terminal operations) if unsure which modes apply.","Inspect the manager's Capabilities to understand which retry modes it supports."],"exampleFix":"// before — assuming retry-as-admin is always available\nIpcOperationApi.RetryOperation(opId, \"retry-as-admin\");\n// after\nvar info = IpcOperationApi.GetOperation(opId);\nvar mode = info.AvailableRetryModes.Contains(\"retry-as-admin\")\n    ? \"retry-as-admin\"\n    : info.AvailableRetryModes.FirstOrDefault() ?? \"retry\";\nIpcOperationApi.RetryOperation(opId, mode);","handlingStrategy":"validation","validationCode":"var info = IpcOperationApi.GetOperation(operationId);\nif (!info.AvailableRetryModes.Contains(retryMode ?? \"retry\"))\n    throw new ArgumentException($\"Retry mode '{retryMode}' not available. Valid: {string.Join(\", \", info.AvailableRetryModes)}\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always read AvailableRetryModes before selecting a retry mode.","Start with 'retry' (the default) if unsure — it is always available for terminal operations.","Manager capabilities (CanRunAsAdmin, CanRunInteractively, CanSkipIntegrityChecks) determine which modes are offered."],"tags":["operations","ipc","validation","retry","capabilities"],"backgroundTag":null,"analyzedSha":"9b1d7d0eab91620fc15c86b36676532095936ae3","analyzedAt":"2026-08-13T12:19:18.278Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}