{"record":{"id":"071e8a0f7fb37ac6","repo":"nats-io/nats-server","slug":"jetstream-not-enabled","errorCode":null,"errorMessage":"jetstream not enabled","messagePattern":"jetstream not enabled","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"server/monitor.go","lineNumber":3235,"sourceCode":"\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif !optCfg {\n\t\t\t\t\t\t\tcInfo.Config = nil\n\t\t\t\t\t\t}\n\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 {","sourceCodeStart":3217,"sourceCodeEnd":3253,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/monitor.go#L3217-L3253","documentation":"JszAccount returns this when the server has no JetStream service (getJetStream() returns nil), i.e. JetStream was not enabled on this server via configuration. There is no JetStream account data to report.","triggerScenarios":"Calling JszAccount (or hitting /jsz?acc=NAME) on a server whose config lacks the jetstream {} block; calling it before JetStream initialization on a server where it is conditionally enabled.","commonSituations":"Uniform monitoring tooling pointed at a mixed cluster where some nodes run without JetStream; after removing the jetstream config block to disable it; default-config servers that never enabled JetStream.","solutions":["Enable JetStream in the server config: add jetstream { store_dir: \"/path\" } and restart","Route jsz monitoring requests only to servers known to have JetStream enabled (check /varz or ServerID against your deployment inventory)","Handle the error as 'feature unavailable' and skip JetStream panels for this node"],"exampleFix":"// before (nats-server.conf)\n// no jetstream block\n// after\njetstream {\n  store_dir: \"/data/nats\"\n}","handlingStrategy":"fallback","validationCode":"// check via varz whether jetstream is enabled before calling JszAccount\nfunc jetstreamEnabled(v *server.Varz) bool { return v.Config != nil && v.Config.JetStream }\n// or via /jsz on the server root returning 404/error when disabled","typeGuard":null,"tryCatchPattern":"detail, err := srv.JszAccount(opts)\nif err != nil && err.Error() == \"jetstream not enabled\" {\n\treturn nil, nil // feature unavailable on this node\n}","preventionTips":["Maintain an inventory of which nodes run JetStream and route jsz queries accordingly","Detect this once per node and cache the capability flag","Enable JetStream explicitly in config when you deploy monitoring that expects it"],"tags":["jetstream","monitoring","configuration"],"backgroundTag":"jetstream-not-enabled","analyzedSha":"3a66a489d262bf89b71a71c955c94920394532f3","analyzedAt":"2026-09-02T04:41:54.247Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}