{"record":{"id":"03df8efe9096b972","repo":"nats-io/nats-server","slug":"failed-to-get-consumer-state-for-s-s","errorCode":null,"errorMessage":"failed to get consumer state for '%s > %s'","messagePattern":"failed to get consumer state for '(.+?) > (.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/stream_backup.go","lineNumber":193,"sourceCode":"\t\t\t\tAckFloor: SequencePair{\n\t\t\t\t\tConsumer: ci.AckFloor.Consumer,\n\t\t\t\t\tStream:   ci.AckFloor.Stream,\n\t\t\t\t},\n\t\t\t}\n\t\t\tif ci.NumAckPending > 0 {\n\t\t\t\t// Cluster consumer info does not include the sparse pending state.\n\t\t\t\t// Roll back to the ack floor so all possibly unacknowledged messages\n\t\t\t\t// are delivered again instead of guessing which ones are pending.\n\t\t\t\tstate.Delivered = state.AckFloor\n\t\t\t}\n\t\t\treturn state\n\t\t}\n\n\t\tif clustered {\n\t\t\tfor _, ca := range consumerAssignments {\n\t\t\t\tci, err := sysRequest[ConsumerInfo](js.srv, clusterConsumerInfoT, sa.Client.serviceAccount(), sa.Config.Name, ca.Name)\n\t\t\t\tif err != nil || ci == nil {\n\t\t\t\t\terrCh <- fmt.Errorf(\"failed to get consumer state for '%s > %s'\", sa.Config.Name, ca.Name)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tif err := writeConsumerMsg(SnapshotConsumerState{\n\t\t\t\t\tConsumerConfig: ca.Config,\n\t\t\t\t\tConsumerState:  consumerStateFromInfo(ci),\n\t\t\t\t}); err != nil {\n\t\t\t\t\terrCh <- err\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor _, o := range consumerStores {\n\t\t\t\tconfig := o.GetConfig()\n\t\t\t\tstate, err := o.State()\n\t\t\t\tif err != nil {\n\t\t\t\t\terrCh <- fmt.Errorf(\"couldn't load consumer '%s' state: %s\", config.Name, err)\n\t\t\t\t\treturn\n\t\t\t\t}","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/stream_backup.go#L175-L211","documentation":"Emitted during a clustered stream snapshot when the internal $JS.API.CLUSTER.CONSUMER.INFO request to a peer replica returns an error or a nil ConsumerInfo for a consumer that has a RAFT assignment. The 'stream > consumer' names identify which assignment's state could not be fetched, so the snapshot cannot capture that consumer's delivered/ack floors.","triggerScenarios":"Thrown at server/stream_backup.go:193 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check JetStream cluster health and consumer replica assignments (stream and consumer RAFT leaders) before starting the snapshot","Retry the snapshot after the cluster settles; transient leadership changes can make the internal sysRequest fail","Verify the consumer still exists on the expected peer and that the account has the correct permissions for the internal service request"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3a66a489d262bf89b71a71c955c94920394532f3","analyzedAt":"2026-09-02T04:41:54.247Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}