{"record":{"id":"90ef8d63ef796152","repo":"nats-io/nats-server","slug":"timeout-after-v-request-type-q-on-q-got-d-ou","errorCode":null,"errorMessage":"timeout after %v: request type %q on %q: got %d out of %d","messagePattern":"timeout after (.+?): request type %q on %q: got (.+?) out of (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/mqtt.go","lineNumber":1754,"sourceCode":"\t\t\tc++\n\t\t\tif c == len(msgs) {\n\t\t\t\treturn responses, nil\n\t\t\t}\n\n\t\tcase <-jsa.quitCh:\n\t\t\treturn nil, ErrServerNotRunning\n\n\t\tcase <-t.C:\n\t\t\tvar reply string\n\t\t\tnow := time.Now()\n\t\t\tfor reply = range r2i { // preserve the last value for Errorf\n\t\t\t\tjsa.replies.Delete(reply)\n\t\t\t}\n\n\t\t\tif len(msgs) == 1 {\n\t\t\t\treturn responses, fmt.Errorf(\"timeout after %v: request type %q on %q (reply=%q)\", now.Sub(start), kind, subject, reply)\n\t\t\t} else {\n\t\t\t\treturn responses, fmt.Errorf(\"timeout after %v: request type %q on %q: got %d out of %d\", now.Sub(start), kind, subject, c, len(msgs))\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (jsa *mqttJSA) sendAck(ackSubject string) {\n\t// Send to the ack subject with no payload.\n\tjsa.sendMsg(ackSubject, nil)\n}\n\nfunc (jsa *mqttJSA) sendMsg(subj string, msg []byte) {\n\tif subj == _EMPTY_ {\n\t\treturn\n\t}\n\t// We pass -1 for the hdr so that the send loop does not need to\n\t// add the \"client info\" header. This is not a JS API request per se.\n\tjsa.sendq.push(&mqttJSPubMsg{subj: subj, msg: msg, hdr: -1})\n}","sourceCodeStart":1736,"sourceCodeEnd":1772,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/mqtt.go#L1736-L1772","documentation":"Multi-response variant of the JSAPI request timeout: the MQTT adapter requested N responses (e.g. expecting replies from multiple nodes/consumers) but only got some within the timeout, so it reports how many of the expected responses arrived. Indicates partial responsiveness of the JetStream layer.","triggerScenarios":"A JS API request expecting multiple replies (c counter vs len(msgs)) times out with partial responses received — e.g. some cluster members respond, others are slow/down.","commonSituations":"Degraded cluster: some JS peers down or partitioned; uneven load causing some nodes to respond after the deadline; consumer fan-out requests on a partially healthy stream.","solutions":["Restore unhealthy cluster members or fix the network partition so all JS peers respond","Check nats server report jetstream for lagging replicas and restart/replace them","Retry the operation once the cluster is fully healthy","Raise server resources if nodes are too slow to answer within the timeout"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Verify all JS peers respond before partial-response-prone operations:\nfor _, s := range nc.Servers() {\n    // check each server's JS enabled/healthy state via monitoring endpoint /jsz\n}","typeGuard":null,"tryCatchPattern":"if strings.Contains(err.Error(), \"got \") && strings.Contains(err.Error(), \"out of \") {\n    // partial responses: identify lagging replicas and retry after recovery\n    return retryWithBackoff(op)\n}","preventionTips":["Run jsz monitoring to catch lagging replicas early","Keep replica counts healthy; replace dead nodes quickly","Avoid asking for quorum-style internal ops while nodes are down"],"tags":["jetstream","mqtt","timeout","partial-response","cluster"],"backgroundTag":"request-timeout","analyzedSha":"3a66a489d262bf89b71a71c955c94920394532f3","analyzedAt":"2026-09-02T04:41:54.247Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}