{"record":{"id":"a30ad2706dd5afde","repo":"nats-io/nats-server","slug":"cdr-error","errorCode":null,"errorMessage":"cdr.Error","messagePattern":"cdr\\.Error","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/stream.go","lineNumber":3066,"sourceCode":"\t\t\tdefault:\n\t\t\t}\n\t\t})\n\t\tif err != nil {\n\t\t\twarn(err)\n\t\t\treturn\n\t\t}\n\t\tdefer acc.unsubscribeInternal(cdSub)\n\n\t\t// Send the delete request.\n\t\terr = s.sendInternalAccountMsgWithReply(acc, subject, reply, nil, nil, false)\n\t\tif err != nil {\n\t\t\twarn(err)\n\t\t\treturn\n\t\t}\n\t\tselect {\n\t\tcase cdr := <-respCh:\n\t\t\tif cdr.Error != nil {\n\t\t\t\twarn(cdr.Error)\n\t\t\t}\n\t\tcase <-time.After(sourceHealthCheckInterval):\n\t\t\twarn(errors.New(\"timed out\"))\n\t\t}\n\t}()\n}\n\n// Small helper to return the Name field from mset.cfg, protected by\n// the mset.cfgMu mutex. This is simply because we have several places\n// in consumer.go where we need it.\nfunc (mset *stream) getCfgName() string {\n\tmset.cfgMu.RLock()\n\tdefer mset.cfgMu.RUnlock()\n\treturn mset.cfg.Name\n}\n\n// Purge will remove all messages from the stream and underlying store based on the request.\nfunc (mset *stream) purge(preq *JSApiStreamPurgeRequest) (purged uint64, err error) {","sourceCodeStart":3048,"sourceCodeEnd":3084,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/stream.go#L3048-L3084","documentation":"In the async consumer-cleanup goroutine, the JS API consumer-delete response arrived but carried a non-nil Error field — the remote/account delete of the source consumer failed (e.g. not found, permissions, server error). The failure is logged with full account/stream/consumer context; the goroutine exits without retry.","triggerScenarios":"Thrown at server/stream.go:3066 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect cdr.Error to identify why the remote delete failed","Delete the leftover consumer manually via the JS API if it persists","Check cross-account permissions and remote server health for mirrors/sources"],"exampleFix":null,"handlingStrategy":"fallback","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"}