{"record":{"id":"a7dfb0cd7e47483e","repo":"nats-io/nats-server","slug":"v-a7dfb0","errorCode":null,"errorMessage":"%v","messagePattern":"%v","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/stream.go","lineNumber":3043,"sourceCode":"\t\tsubject = strings.Replace(subject, JSApiPrefix, source.External.ApiPrefix, 1)\n\t\tsubject = strings.ReplaceAll(subject, \"..\", \".\")\n\t}\n\ts := mset.srv\n\tgo func() {\n\t\twarn := func(err error) {\n\t\t\tif log {\n\t\t\t\ts.Warnf(\"Cleanup of %s consumer '%s > %s' failed for stream '%s > %s': %v\", kind, sourceName, consumerName, accName, streamName, err)\n\t\t\t}\n\t\t}\n\n\t\trespCh := make(chan *JSApiConsumerDeleteResponse, 1)\n\t\treply := infoReplySubject()\n\t\tcdSub, err := acc.subscribeInternal(reply, func(sub *subscription, c *client, _ *Account, subject, reply string, rmsg []byte) {\n\t\t\t_, msg := c.msgParts(rmsg)\n\n\t\t\tvar cdr JSApiConsumerDeleteResponse\n\t\t\tif err := json.Unmarshal(msg, &cdr); err != nil {\n\t\t\t\twarn(err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tselect {\n\t\t\tcase respCh <- &cdr:\n\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","sourceCodeStart":3025,"sourceCodeEnd":3061,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/stream.go#L3025-L3061","documentation":"Emitted by the warn helper inside the async consumer-cleanup goroutine (deleting a source/mirror consumer during stream teardown when the owning account differs). It wraps failures such as JSON unmarshal of the delete response, reporting which account/stream/consumer cleanup failed and why; the goroutine then gives up for that consumer.","triggerScenarios":"Thrown at server/stream.go:3043 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped error (malformed response usually indicates a protocol/version mismatch)","Manually delete the leftover consumer via the JS API if it persists","Upgrade mismatched clusters so internal delete responses parse correctly"],"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"}