{"record":{"id":"7e774dc56f2c2fa4","repo":"nats-io/nats-server","slug":"account-q-not-found","errorCode":null,"errorMessage":"account %q not found","messagePattern":"account %q not found","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"server/monitor.go","lineNumber":3240,"sourceCode":"\t\t\t\t\t\tsdet.DirectConsumer = append(sdet.DirectConsumer, cInfo)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tdetail.Streams = append(detail.Streams, sdet)\n\t\t}\n\t}\n\treturn &detail\n}\n\nfunc (s *Server) JszAccount(opts *JSzOptions) (*AccountDetail, error) {\n\tjs := s.getJetStream()\n\tif js == nil {\n\t\treturn nil, fmt.Errorf(\"jetstream not enabled\")\n\t}\n\tacc := opts.Account\n\taccount, ok := s.accounts.Load(acc)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"account %q not found\", acc)\n\t}\n\tjs.mu.RLock()\n\tjsa, ok := js.accounts[account.(*Account).Name]\n\tjs.mu.RUnlock()\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"account %q not jetstream enabled\", acc)\n\t}\n\treturn s.accountDetail(jsa, opts.Streams, opts.Consumer, opts.DirectConsumer, opts.Config, opts.RaftGroups, opts.StreamLeaderOnly), nil\n}\n\n// helper to get cluster info from node via dummy group\nfunc (s *Server) raftNodeToClusterInfo(node RaftNode) *ClusterInfo {\n\tif node == nil {\n\t\treturn nil\n\t}\n\tpeers := node.Peers()\n\tpeerList := make([]string, len(peers))\n\tfor i, p := range peers {","sourceCodeStart":3222,"sourceCodeEnd":3258,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/monitor.go#L3222-L3258","documentation":"JszAccount validates that the requested account name exists in the server's account map and fails with this error when it doesn't. Unlike error 625, JetStream itself is enabled; only the account lookup fails.","triggerScenarios":"Calling JszAccount with opts.Account set to a name not loaded on this server; hitting /jsz?acc=MISSING on a node where that account was never activated.","commonSituations":"Monitoring dashboards iterating over accounts defined in a central config not yet propagated to all servers; typos in account names; clustered deployments where the account only exists on other nodes.","solutions":["Confirm the account name via /accountz or the server's config, then retry with the exact name","Only request JszAccount for accounts active on the queried node","On clusters, query the node where the account's clients/streams are located"],"exampleFix":"// before\ndetail, err := s.JszAccount(&server.JSzOptions{Account: \"MISSING\"})\n// after\ndetail, err := s.JszAccount(&server.JSzOptions{Account: \"EXISTING_ACC\"})","handlingStrategy":"validation","validationCode":"// confirm the account exists before JszAccount\naz, err := srv.Accountz(&server.AccountzOptions{})\n// then check az.Accounts for opts.Account before calling JszAccount","typeGuard":null,"tryCatchPattern":"detail, err := srv.JszAccount(opts)\nif err != nil && strings.Contains(err.Error(), \"not found\") {\n\treturn nil, fmt.Errorf(\"account %q is not loaded on this server\", opts.Account)\n}","preventionTips":["Resolve account names from /accountz, never from free text","In clusters, target the node where the account's streams live","Trigger account activation (client connect) before querying freshly configured accounts"],"tags":["jetstream","monitoring","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"}