{"record":{"id":"aa875f45d93ba9ca","repo":"itsfatduck/optimizerDuck","slug":"revert-error-stepfailed","errorCode":null,"errorMessage":"Revert.Error.StepFailed","messagePattern":"Revert\\.Error\\.StepFailed","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"optimizerDuck/Services/Revert/RevertManager.cs","lineNumber":150,"sourceCode":"            var remaining = total - i;\n            progress?.Report(\n                new ProcessingProgress\n                {\n                    Message = Loc.Instance[\n                        \"Optimization.Revert.ExecutingStep\",\n                        remaining,\n                        total,\n                        step.Type\n                    ],\n                    Value = remaining,\n                    Total = total,\n                }\n            );\n\n            try\n            {\n                if (!await step.ExecuteAsync(_shell, _logger).ConfigureAwait(false))\n                    throw new Exception(Loc.Instance[\"Revert.Error.StepFailed\"]);\n            }\n            catch (Exception ex)\n            {\n                _logger.LogError(\n                    ex,\n                    \"Revert step {StepType} failed for {Optimization}\",\n                    step.Type,\n                    optimization.OptimizationKey\n                );\n\n                var stepEx = ex as StepExecutionException;\n                failedSteps.Add(\n                    new Change\n                    {\n                        Index = idx,\n                        Name = step.Type,\n                        Description = step.Description,\n                        Ok = false,","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/itsfatduck/optimizerDuck/blob/36acf585ae122a09f0e29eb4acedfaf94e81c0de/optimizerDuck/Services/Revert/RevertManager.cs#L132-L168","documentation":"Aggregated revert-step failure surfaced by RevertManager.RevertAsync: a step's ExecuteAsync returned false (the per-step failure policy records a failed Change instead of throwing), and RevertManager converts that bool into an exception to abort the revert loop. The localized 'Revert.Error.StepFailed' message is a generic sentinel — the actual cause is in the failed step's Change/error detail; the input at fault is the specific revert step being executed at that iteration.","triggerScenarios":"Thrown at optimizerDuck/Services/Revert/RevertManager.cs:150 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the failed step's Change record and exception detail (logged via the ILogger passed to ExecuteAsync) to identify the underlying cause — access denied, missing original value, or external modification","Re-run the revert operation: revert steps are idempotent (they re-verify their own effect), so already-restored steps succeed as no-ops and the loop resumes at the failing step","For access-denied failures, confirm the app is elevated (requireAdministrator manifest) and that no GPO/antivirus is blocking writes to the target key, service, or task","If the revert file refers to a step type from an older version, update the app so the step type is registered, then retry"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"36acf585ae122a09f0e29eb4acedfaf94e81c0de","analyzedAt":"2026-09-13T08:30:13.845Z","contentChangedAt":"2026-09-13T08:30:13.845Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}