{"record":{"id":"7cbc04cac944699c","repo":"nats-io/nats-server","slug":"consumer-node-missing","errorCode":null,"errorMessage":"consumer node missing","messagePattern":"consumer node missing","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"server/jetstream_cluster.go","lineNumber":1137,"sourceCode":"\t}\n\n\toNode := o.raftNode()\n\trc, _ := o.replica()\n\tvar nrgWerr error\n\tif node != nil {\n\t\tnrgWerr = node.GetWriteErr()\n\t}\n\tconsumerWerr := o.getWriteErr()\n\tswitch {\n\tcase rc <= 1:\n\t\treturn nil // No further checks for R=1 consumers\n\n\tcase node == nil:\n\t\treturn errors.New(\"group node missing\")\n\n\tcase oNode == nil:\n\t\t// Can happen when the consumer's node is not yet initialized.\n\t\treturn errors.New(\"consumer node missing\")\n\n\tcase node != oNode:\n\t\tmset.mu.RLock()\n\t\taccName, streamName := mset.acc.GetName(), mset.cfg.Name\n\t\tmset.mu.RUnlock()\n\t\ts.Warnf(\"Detected consumer cluster node skew '%s > %s > %s'\", accName, streamName, consumer)\n\t\treturn errors.New(\"cluster node skew detected\")\n\n\tcase nrgWerr != nil:\n\t\treturn fmt.Errorf(\"node write error: %v\", nrgWerr)\n\n\tcase consumerWerr != nil:\n\t\treturn fmt.Errorf(\"consumer write error: %v\", consumerWerr)\n\n\tcase !o.isMonitorRunning():\n\t\treturn errors.New(\"monitor goroutine not running\")\n\n\tcase !node.Healthy():","sourceCodeStart":1119,"sourceCodeEnd":1155,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/jetstream_cluster.go#L1119-L1155","documentation":"Returned when the consumer's runtime object exists but o.raftNode() is nil — the consumer's own raft node has not been initialized yet, even though the group assignment node exists. The source notes this can happen when the consumer's node is not yet initialized, i.e. the consumer was created but its replicated state machine has not started.","triggerScenarios":"Health check between consumer materialization and raft node start: lookupConsumer succeeded but o.raftNode() is nil — e.g. consumer create in progress, or raft node start deferred/failed after recovery.","commonSituations":"Polling /jsz?health=true immediately after creating a replicated consumer; server restart where consumer recovery is still initializing nodes; low-resource or heavily loaded servers delaying node start.","solutions":["Retry the health check after a short delay to allow raft node initialization to finish.","Inspect server logs for raft/node startup errors and address them (disk, WAL issues).","If stuck indefinitely, restart the server so the consumer's node is recreated during recovery.","Reduce consumer creation bursts so node initialization is not backlogged."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Go: allow a warm-up window for node initialization\nif err := health(); err != nil && strings.Contains(err.Error(), \"consumer node missing\") {\n    select {\n    case <-time.After(3 * time.Second):\n        return health() // recheck once initialized\n    case <-ctx.Done():\n        return ctx.Err()\n    }\n}","preventionTips":["Give servers a warm-up period after restart before health-gating","Avoid bursting many replicated consumer creations at once","Watch logs for raft node startup failures","Ensure adequate disk and CPU for raft initialization"],"tags":["jetstream","nats","raft","consumers"],"backgroundTag":"jetstream-health-check-failed","analyzedSha":"3a66a489d262bf89b71a71c955c94920394532f3","analyzedAt":"2026-09-02T04:41:54.247Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}