router-for-me/CLIProxyAPI · error

observation barrier revision must not be negative

Error message

observation barrier revision must not be negative

What it means

ValidateCredentialConcurrency rejects a negative value for 'credential-concurrency.observation-barrier-revision'. This revision orders the observation barrier handshake for in-flight credential accounting; unlike the lifecycle revision, zero is allowed (unset/default), but any negative value is invalid.

Source

Thrown at internal/config/credential_concurrency.go:147

	if !c.busyRetryMinPresent && c.BusyRetryMin == 0 {
		c.BusyRetryMin = defaultBusyRetryMin
	}
	if !c.busyRetryMaxPresent && c.BusyRetryMax == 0 {
		c.BusyRetryMax = defaultBusyRetryMax
	}
	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)

View on GitHub (pinned to 78f0c4079e)

Solutions

  1. Set observation-barrier-revision to 0 or a positive integer.
  2. If your templating uses -1 as 'unset', remove the key from the template instead of emitting -1.
  3. Re-run config validation via server startup or the management API to confirm.

Example fix

# before (config.yaml)
credential-concurrency:
  observation-barrier-revision: -1

# after
credential-concurrency:
  observation-barrier-revision: 1
Defensive patterns

Strategy: validation

Validate before calling

// Go: guard observation-barrier-revision before submission.
if cfg.CredentialConcurrency.ObservationBarrierRevision < 0 {
    return errors.New("observation-barrier-revision must be >= 0")
}

Prevention

When it happens

Trigger: config.yaml with 'credential-concurrency:\n observation-barrier-revision: -1' or any negative integer under that key.

Common situations: Template systems substituting -1 as a 'not set' sentinel for integers; hand-editing revisions and accidentally flipping the sign; copying fixture data from tests that exercise invalid inputs.

Related errors


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