{"record":{"id":"5e9ffa46d09d37df","repo":"nats-io/nats-server","slug":"account-resolver-update-too-soon","errorCode":null,"errorMessage":"account resolver update too soon","messagePattern":"account resolver update too soon","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"server/errors.go","lineNumber":132,"sourceCode":"\tErrMissingService = errors.New(\"service missing\")\n\n\t// ErrBadServiceType is returned when latency tracking is being applied to non-singleton response types.\n\tErrBadServiceType = errors.New(\"bad service response type\")\n\n\t// ErrBadSampling is returned when the sampling for latency tracking is not 1 >= sample <= 100.\n\tErrBadSampling = errors.New(\"bad sampling percentage, should be 1-100\")\n\n\t// ErrAccountValidation is returned when an account has failed validation.\n\tErrAccountValidation = errors.New(\"account validation failed\")\n\n\t// ErrAccountExpired is returned when an account has expired.\n\tErrAccountExpired = errors.New(\"account expired\")\n\n\t// ErrNoAccountResolver is returned when we attempt an update but do not have an account resolver.\n\tErrNoAccountResolver = errors.New(\"account resolver missing\")\n\n\t// ErrAccountResolverUpdateTooSoon is returned when we attempt an update too soon to last request.\n\tErrAccountResolverUpdateTooSoon = errors.New(\"account resolver update too soon\")\n\n\t// ErrAccountResolverSameClaims is returned when same claims have been fetched.\n\tErrAccountResolverSameClaims = errors.New(\"account resolver no new claims\")\n\n\t// ErrStreamImportAuthorization is returned when a stream import is not authorized.\n\tErrStreamImportAuthorization = errors.New(\"stream import not authorized\")\n\n\t// ErrStreamImportBadPrefix is returned when a stream import prefix contains wildcards.\n\tErrStreamImportBadPrefix = errors.New(\"stream import prefix can not contain wildcard tokens\")\n\n\t// ErrStreamImportDuplicate is returned when a stream import is a duplicate of one that already exists.\n\tErrStreamImportDuplicate = errors.New(\"stream import already exists\")\n\n\t// ErrServiceImportAuthorization is returned when a service import is not authorized.\n\tErrServiceImportAuthorization = errors.New(\"service import not authorized\")\n\n\t// ErrImportFormsCycle is returned when an import would form a cycle.\n\tErrImportFormsCycle = errors.New(\"import forms a cycle\")","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/errors.go#L114-L150","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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"],"exampleFix":"// before\nfor {\n\t_, err := s.fetchUpdatedAccount(acc) // spins -> ErrAccountResolverUpdateTooSoon\n}\n// after\nif err := s.fetchUpdatedAccount(acc); errors.Is(err, ErrAccountResolverUpdateTooSoon) {\n\ttime.Sleep(resolverThrottleInterval) // backoff before retry\n}","handlingStrategy":"retry","validationCode":"// check throttle before requesting\nif time.Since(acc.lastUpdate) < resolverThrottleInterval { return ErrAccountResolverUpdateTooSoon }","typeGuard":"null","tryCatchPattern":"err := s.fetchUpdatedAccount(acc)\nif errors.Is(err, ErrAccountResolverUpdateTooSoon) { backoffAndRetry(acc) } // exponential backoff within throttle window","preventionTips":["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"],"tags":["nats","server","account-resolver","rate-limiting"],"backgroundTag":"rate-limit-exceeded","analyzedSha":"3a66a489d262bf89b71a71c955c94920394532f3","analyzedAt":"2026-09-02T04:41:54.247Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}