{"record":{"id":"5955f44b8136a729","repo":"nats-io/nats-server","slug":"couldn-t-load-consumer-s-state-s","errorCode":null,"errorMessage":"couldn't load consumer '%s' state: %s","messagePattern":"couldn't load consumer '(.+?)' state: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/stream_backup.go","lineNumber":209,"sourceCode":"\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}\n\t\t\t\tif err := writeConsumerMsg(SnapshotConsumerState{\n\t\t\t\t\tConsumerConfig: config,\n\t\t\t\t\tConsumerState:  state,\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}\n\t}\n\n\tvar sm StoreMsg\n\tfor seq := state.FirstSeq - 1; seq < state.LastSeq; {\n\t\tif _, seq, err = store.LoadNextMsg(fwcs, true, seq+1, &sm); err != nil {\n\t\t\tif err == ErrStoreEOF {\n\t\t\t\tbreak","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/stream_backup.go#L191-L227","documentation":"Emitted during a non-clustered (single-server) stream snapshot when ConsumerStore.State() fails for a locally tracked consumer. The wrapped error usually comes from the underlying message store (file or memory) and means the consumer's persisted state could not be read, aborting the backup of that consumer's config/state entry.","triggerScenarios":"Thrown at server/stream_backup.go:209 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped error; file-store corruption or a locked state file are typical root causes","Run nats stream info / consumer report against the server to surface store-level errors","Repair or recover the stream store (e.g. restore from replicas or a prior backup) and re-run the snapshot"],"exampleFix":null,"handlingStrategy":"try-catch","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-08T10:18:20.063Z"}