{"record":{"id":"12cfe9c40c8476e1","repo":"nats-io/nats-server","slug":"account-s-does-not-exist","errorCode":null,"errorMessage":"Account %s does not exist","messagePattern":"Account (.+?) does not exist","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"server/monitor.go","lineNumber":2847,"sourceCode":"\t\t\tType:    jwt.Service,\n\t\t\t// Deprecated so we duplicate. Use LocalSubject.\n\t\t\tTo:           jwt.Subject(v.from),\n\t\t\tLocalSubject: jwt.RenamingSubject(v.from),\n\t\t}\n\t\timp.TrackingHdr = v.trackingHdr\n\t\timp.Latency = newExtServiceLatency(v.latency)\n\t\tif v.m1 != nil {\n\t\t\tm1 := *v.m1\n\t\t\timp.M1 = &m1\n\t\t}\n\t}\n\treturn imp\n}\n\nfunc (s *Server) accountInfo(accName string) (*AccountInfo, error) {\n\tvar a *Account\n\tif v, ok := s.accounts.Load(accName); !ok {\n\t\treturn nil, fmt.Errorf(\"Account %s does not exist\", accName)\n\t} else {\n\t\ta = v.(*Account)\n\t}\n\tisSys := a == s.SystemAccount()\n\ta.mu.RLock()\n\tdefer a.mu.RUnlock()\n\tvar vrIssues []ExtVrIssues\n\tclaim, _ := jwt.DecodeAccountClaims(a.claimJWT) // ignore error\n\tif claim != nil {\n\t\tvr := jwt.ValidationResults{}\n\t\tclaim.Validate(&vr)\n\t\tvrIssues = make([]ExtVrIssues, len(vr.Issues))\n\t\tfor i, v := range vr.Issues {\n\t\t\tvrIssues[i] = ExtVrIssues{v.Description, v.Blocking, v.TimeCheck}\n\t\t}\n\t}\n\tcollectRevocations := func(revocations map[string]int64) map[string]time.Time {\n\t\tl := len(revocations)","sourceCodeStart":2829,"sourceCodeEnd":2865,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/monitor.go#L2829-L2865","documentation":"accountInfo looks up the account by name in the server's account map and returns this error when no account with that name exists. It backs the /accountz monitoring endpoint (and JszAccount paths) for a named account.","triggerScenarios":"Requesting /accountz?acc=NAME for an account not loaded on this server; calling accountInfo/Accountz with a mistyped account name or one that exists only on other cluster members.","commonSituations":"Monitoring dashboards tracking accounts from a config file that hasn't been applied to this server; querying a specific node in a cluster where the account hasn't been activated yet (accounts materialize on demand); renaming accounts in config without updating tooling.","solutions":["Verify the account name matches an account defined in the server's configuration or resolvable via the resolver","Use /accountz without the acc parameter to list all accounts and confirm the correct name","Ensure the account has been used/activated on this node (e.g. a client connected) before querying by name in clustered setups"],"exampleFix":"// before\nGET /accountz?acc=OLD_NAME   -> 404-style error\n// after\nGET /accountz                // list accounts first\nGET /accountz?acc=CURRENT_NAME","handlingStrategy":"try-catch","validationCode":"var accounts []server.Accountz\n// fetch /accountz first and confirm the name exists before querying by acc=\nfunc accountExists(list *server.Accountz, name string) bool {\n\tfor _, a := range list.Accounts {\n\t\tif a.Account.Name == name {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}","typeGuard":null,"tryCatchPattern":"info, err := srv.Accountz(&server.AccountzOptions{Account: name})\nif err != nil && strings.Contains(err.Error(), \"does not exist\") {\n\t// fall back to listing all accounts\n}","preventionTips":["Discover account names via /accountz instead of hardcoding them","In clusters, check whether the account is active on the queried node","Keep monitoring tooling in sync with account renames in config"],"tags":["monitoring","accountz","not-found"],"backgroundTag":"account-not-found","analyzedSha":"3a66a489d262bf89b71a71c955c94920394532f3","analyzedAt":"2026-09-02T04:41:54.247Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}