router-for-me/CLIProxyAPI · error

credential concurrency limiter durations must be positive

Error message

credential concurrency limiter durations must be positive

What it means

ValidateCredentialConcurrency requires the four limiter durations to be strictly positive: release-flush-interval, release-max-backoff, busy-retry-min, and busy-retry-max. These tune the token/limiter release path (flush cadence, backoff ceiling) and the busy-credential retry window; zero or negative values would stall release processing.

Source

Thrown at internal/config/credential_concurrency.go:153

	if !c.maxLimitPresent && c.MaxLimit == 0 {
		c.MaxLimit = maxCredentialConcurrencyLimit
	}
	return c
}

// ValidateCredentialConcurrency validates values intrinsic to a credential concurrency configuration.
func ValidateCredentialConcurrency(cfg CredentialConcurrencyConfig) error {
	if cfg.LifecycleConfigRevision < 0 || (cfg.lifecycleConfigRevisionPresent && cfg.LifecycleConfigRevision == 0) {
		return fmt.Errorf("lifecycle configuration revision must be positive when present")
	}
	if cfg.ObservationBarrierRevision < 0 {
		return fmt.Errorf("observation barrier revision must not be negative")
	}
	if cfg.CPAHeartbeatTimeout <= 0 || cfg.CPACancelBound <= 0 || cfg.ReclaimGrace <= 0 || cfg.CleanupInterval <= 0 {
		return fmt.Errorf("credential concurrency lifecycle durations must be positive")
	}
	if cfg.ReleaseFlushInterval <= 0 || cfg.ReleaseMaxBackoff <= 0 || cfg.BusyRetryMin <= 0 || cfg.BusyRetryMax <= 0 {
		return fmt.Errorf("credential concurrency limiter durations must be positive")
	}
	if cfg.ReleaseMaxBackoff < cfg.ReleaseFlushInterval {
		return fmt.Errorf("credential concurrency release max backoff must not be less than release flush interval")
	}
	if cfg.BusyRetryMin%time.Millisecond != 0 || cfg.BusyRetryMax%time.Millisecond != 0 {
		return fmt.Errorf("credential concurrency busy retry durations must be whole milliseconds")
	}
	if cfg.BusyRetryMax < cfg.BusyRetryMin {
		return fmt.Errorf("credential concurrency busy retry max must not be less than busy retry min")
	}
	if cfg.MaxLimit < 1 || cfg.MaxLimit > maxCredentialConcurrencyLimit {
		return fmt.Errorf("credential concurrency max limit must be between 1 and %d", maxCredentialConcurrencyLimit)
	}
	return nil
}

// ValidateCredentialConcurrencyLifecycle verifies the Home lifecycle timing safety invariant.
func ValidateCredentialConcurrencyLifecycle(nodeHeartbeatTimeout time.Duration, cfg CredentialConcurrencyConfig) error {

View on GitHub (pinned to 78f0c4079e)

Solutions

  1. Set all four limiter durations positive: release-flush-interval: 500ms, release-max-backoff: 2s, busy-retry-min: 250ms, busy-retry-max: 1s (defaults from config.example.yaml).
  2. Keep release-max-backoff >= release-flush-interval and busy-retry-max >= busy-retry-min to satisfy sibling checks.
  3. Always suffix durations with a unit (ms, s, m).
  4. Remove keys you do not intend to override so defaults apply.

Example fix

# before (config.yaml)
credential-concurrency:
  release-max-backoff: 0s
  busy-retry-min: 250ms
  busy-retry-max: 1s

# after
credential-concurrency:
  release-flush-interval: 500ms
  release-max-backoff: 2s
  busy-retry-min: 250ms
  busy-retry-max: 1s
Defensive patterns

Strategy: validation

Validate before calling

// Go: pre-validate limiter durations.
func limiterDurationsOK(cfg config.CredentialConcurrencyConfig) bool {
    return cfg.ReleaseFlushInterval > 0 && cfg.ReleaseMaxBackoff > 0 &&
        cfg.BusyRetryMin > 0 && cfg.BusyRetryMax > 0
}

Prevention

When it happens

Trigger: config.yaml credential-concurrency block containing 'release-flush-interval: 0s', 'release-max-backoff: -1s', 'busy-retry-min: 0ms', or 'busy-retry-max: 0s'. Unparseable duration strings that decode to zero also trigger it.

Common situations: Tuning retries down to zero to 'disable backoff'; copying the commented example block but leaving some values as placeholders; mixing units (250 vs 250ms) so a bare integer fails duration decoding.

Related errors


AI-assisted analysis of router-for-me/CLIProxyAPI@78f0c4079e (2026-08-15). Data as JSON: /api/errors/ccec1fdc6eaea962. Report an issue: GitHub.