App-vNext/Polly · error · ArgumentOutOfRangeException

Value must be greater than one.

Error message

Value must be greater than one.

What it means

Thrown at policy-construction time by the legacy Polly v7 AdvancedCircuitBreaker when minimumThroughput is less than or equal to 1. minimumThroughput is the minimum number of actions that must pass through the circuit in a sampling window before failure statistics are considered significant; a value of 0 or 1 makes the breaker unreliable (a single failure could trip it), so Polly requires at least 2 via ArgumentOutOfRangeException.

Source

Thrown at src/Polly/CircuitBreaker/AdvancedCircuitBreakerSyntax.cs:243

        if (failureThreshold <= 0)
        {
            throw new ArgumentOutOfRangeException(nameof(failureThreshold), "Value must be greater than zero.");
        }

        if (failureThreshold > 1)
        {
            throw new ArgumentOutOfRangeException(nameof(failureThreshold), "Value must be less than or equal to one.");
        }

        if (samplingDuration < resolutionOfCircuit)
        {
            throw new ArgumentOutOfRangeException(nameof(samplingDuration), $"Value must be equal to or greater than {resolutionOfCircuit.TotalMilliseconds} milliseconds. This is the minimum resolution of the CircuitBreaker timer.");
        }

        if (minimumThroughput <= 1)
        {
            throw new ArgumentOutOfRangeException(nameof(minimumThroughput), "Value must be greater than one.");
        }

        if (durationOfBreak < TimeSpan.Zero)
        {
            throw new ArgumentOutOfRangeException(nameof(durationOfBreak), "Value must be greater than zero.");
        }

        if (onBreak == null)
        {
            throw new ArgumentNullException(nameof(onBreak));
        }

        if (onReset == null)
        {
            throw new ArgumentNullException(nameof(onReset));
        }

        if (onHalfOpen == null)

View on GitHub (pinned to d0e46bdb1e)

Solutions

  1. Set minimumThroughput to an integer >= 2 (typical values are in the tens, e.g. 10).
  2. Validate configured throughput and fall back to a default (e.g. 10) when it is <= 1.
  3. Double-check the parameter is a count, not a percentage or fraction.

Example fix

// before
.AdvancedCircuitBreaker(0.5, sampling, 1, breakDur, ...);
// after
.AdvancedCircuitBreaker(0.5, sampling, 10, breakDur, ...);
Defensive patterns

Strategy: validation

Validate before calling

if (minimumThroughput <= 1) throw new ArgumentOutOfRangeException(nameof(minimumThroughput), "minimumThroughput must be >= 2.");
.AdvancedCircuitBreaker(failureThreshold, samplingDuration, minimumThroughput, durationOfBreak, onBreak, onReset, onHalfOpen);

Type guard

static bool IsMinimumThroughputValid(int n) => n >= 2;

Prevention

When it happens

Trigger: Calling AdvancedCircuitBreaker/Async with minimumThroughput of 0, 1, or a negative int.

Common situations: Config value missing and defaulted to 0; copy-paste from a doc example that used a placeholder; misunderstanding that this is a count (>=2) not a ratio.

Related errors


AI-assisted analysis of App-vNext/Polly@d0e46bdb1e (2026-08-13). Data as JSON: /api/errors/f6f6ee3c9934361c. Report an issue: GitHub.