App-vNext/Polly · error · ArgumentOutOfRangeException

Value must be greater than one.

Error message

Value must be greater than one.

What it means

Thrown by AdvancedCircuitBreaker<T> when minimumThroughput is <= 1. minimumThroughput is the minimum number of actions in the sampling window required before the circuit can trip, so it must be at least 2 to compute a meaningful failure ratio. Fires at policy construction.

Source

Thrown at src/Polly/CircuitBreaker/AdvancedCircuitBreakerTResultSyntax.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 at least 2 (commonly 10+ for real traffic).
  2. If you want 'break after N exceptions', use the simple CircuitBreaker syntax with exceptionsAllowedBeforeBreaking instead.
  3. Validate the config value is >= 2 at startup.

Example fix

// before
.AdvancedCircuitBreaker(
    ...,
    minimumThroughput: 1,
    ...)

// after
.AdvancedCircuitBreaker(
    ...,
    minimumThroughput: 10,
    ...)
Defensive patterns

Strategy: validation

Validate before calling

if (minimumThroughput <= 1)
    throw new ArgumentOutOfRangeException(nameof(minimumThroughput), "minimumThroughput must be >= 2.");

Type guard

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

Prevention

When it happens

Trigger: Calling AdvancedCircuitBreaker(..., minimumThroughput: 1, ...) or 0 or a negative value. The check is `minimumThroughput <= 1`.

Common situations: Setting minimumThroughput to 1 thinking it means 'break on first failure' (use the simple CircuitBreaker for that), or defaulting it to 0 from missing config.

Related errors


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