nats-io/nats-server · warning
account resolver update too soon
Error message
account resolver update too soon
What it means
ErrAccountResolverUpdateTooSoon is returned when an account resolver update is requested too soon after the last one. The server rate-limits fetches per account (throttled to 2 minutes by default) to avoid hammering the resolver, returning this error instead of re-fetching.
Source
Thrown at server/errors.go:132
ErrMissingService = errors.New("service missing")
// ErrBadServiceType is returned when latency tracking is being applied to non-singleton response types.
ErrBadServiceType = errors.New("bad service response type")
// ErrBadSampling is returned when the sampling for latency tracking is not 1 >= sample <= 100.
ErrBadSampling = errors.New("bad sampling percentage, should be 1-100")
// ErrAccountValidation is returned when an account has failed validation.
ErrAccountValidation = errors.New("account validation failed")
// ErrAccountExpired is returned when an account has expired.
ErrAccountExpired = errors.New("account expired")
// ErrNoAccountResolver is returned when we attempt an update but do not have an account resolver.
ErrNoAccountResolver = errors.New("account resolver missing")
// ErrAccountResolverUpdateTooSoon is returned when we attempt an update too soon to last request.
ErrAccountResolverUpdateTooSoon = errors.New("account resolver update too soon")
// ErrAccountResolverSameClaims is returned when same claims have been fetched.
ErrAccountResolverSameClaims = errors.New("account resolver no new claims")
// ErrStreamImportAuthorization is returned when a stream import is not authorized.
ErrStreamImportAuthorization = errors.New("stream import not authorized")
// ErrStreamImportBadPrefix is returned when a stream import prefix contains wildcards.
ErrStreamImportBadPrefix = errors.New("stream import prefix can not contain wildcard tokens")
// ErrStreamImportDuplicate is returned when a stream import is a duplicate of one that already exists.
ErrStreamImportDuplicate = errors.New("stream import already exists")
// ErrServiceImportAuthorization is returned when a service import is not authorized.
ErrServiceImportAuthorization = errors.New("service import not authorized")
// ErrImportFormsCycle is returned when an import would form a cycle.
ErrImportFormsCycle = errors.New("import forms a cycle")View on GitHub (pinned to 3a66a489d2)
Solutions
- Wait for the throttle window (default ~2 minutes) to elapse before requesting the same account update again
- Add exponential backoff / jitter to update retry loops
- Surface the current account state to clients so they retry later rather than immediately re-triggering
- For tests, reduce the resolver throttle constant (accResolverFetchTimeout / limiter internals) or stub time to advance past the window
Example fix
// before
for {
_, err := s.fetchUpdatedAccount(acc) // spins -> ErrAccountResolverUpdateTooSoon
}
// after
if err := s.fetchUpdatedAccount(acc); errors.Is(err, ErrAccountResolverUpdateTooSoon) {
time.Sleep(resolverThrottleInterval) // backoff before retry
} Defensive patterns
Strategy: retry
Validate before calling
// check throttle before requesting
if time.Since(acc.lastUpdate) < resolverThrottleInterval { return ErrAccountResolverUpdateTooSoon } Type guard
null
Try / catch
err := s.fetchUpdatedAccount(acc)
if errors.Is(err, ErrAccountResolverUpdateTooSoon) { backoffAndRetry(acc) } // exponential backoff within throttle window Prevention
- Add backoff/jitter to account update retries
- Avoid re-triggering lookups for the same account in tight loops
- Cache resolved accounts and reuse them until the throttle window passes
When it happens
Trigger: Calling fetchUpdatedAccount (or triggering an account update via lookup/system requests) for the same account within the throttle window — i.e. before time.Since(acc.lastUpdate) exceeds the limit (server.go:2121).
Common situations: Rapid re-subscriptions or repeated lookups for a not-yet-cached account; retry loops without backoff after a failed fetch; load bursts causing many clients referencing the same new account simultaneously; tests issuing back-to-back updates.
Related errors
- account resolver missing
- service missing
- bad service response type
- bad sampling percentage, should be 1-100
- account validation failed
AI-assisted analysis of nats-io/nats-server@3a66a489d2 (2026-09-02).
Data as JSON: /api/errors/5e9ffa46d09d37df.
Report an issue: GitHub.