itsfatduck/optimizerDuck · error · Exception

Revert.Error.StepFailed

Error message

Revert.Error.StepFailed

What it means

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.

Solutions

  1. 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
  2. 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
  3. 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
  4. If the revert file refers to a step type from an older version, update the app so the step type is registered, then retry
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at optimizerDuck/Services/Revert/RevertManager.cs:150 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of itsfatduck/optimizerDuck@36acf585ae (2026-09-13). Data as JSON: /api/errors/aa875f45d93ba9ca. Report an issue: GitHub.

Appendix: source

Thrown at optimizerDuck/Services/Revert/RevertManager.cs:150

            var remaining = total - i;
            progress?.Report(
                new ProcessingProgress
                {
                    Message = Loc.Instance[
                        "Optimization.Revert.ExecutingStep",
                        remaining,
                        total,
                        step.Type
                    ],
                    Value = remaining,
                    Total = total,
                }
            );

            try
            {
                if (!await step.ExecuteAsync(_shell, _logger).ConfigureAwait(false))
                    throw new Exception(Loc.Instance["Revert.Error.StepFailed"]);
            }
            catch (Exception ex)
            {
                _logger.LogError(
                    ex,
                    "Revert step {StepType} failed for {Optimization}",
                    step.Type,
                    optimization.OptimizationKey
                );

                var stepEx = ex as StepExecutionException;
                failedSteps.Add(
                    new Change
                    {
                        Index = idx,
                        Name = step.Type,
                        Description = step.Description,
                        Ok = false,

View on GitHub (pinned to 36acf585ae)