{"record":{"id":"9c16723a67047048","repo":"nats-io/nats-server","slug":"not-requesting-votes-for-q-could-not-persist-ter","errorCode":null,"errorMessage":"Not requesting votes for %q, could not persist term and vote: %v","messagePattern":"Not requesting votes for %q, could not persist term and vote: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/raft.go","lineNumber":5694,"sourceCode":"\t\tn.error(\"Received malformed vote request for %q\", n.group)\n\t\treturn\n\t}\n\tn.reqs.push(vr)\n}\n\nfunc (n *raft) requestVote() {\n\tn.Lock()\n\tif n.State() != Candidate {\n\t\tn.Unlock()\n\t\treturn\n\t}\n\tn.vote = n.id\n\tif err := n.writeTermVote(); err != nil {\n\t\t// Make sure that our self-vote is persisted durably before campaigning, otherwise\n\t\t// we could vote for someone else in the same term after a restart.\n\t\tn.vote = noVote\n\t\tn.Unlock()\n\t\tn.warn(\"Not requesting votes for %q, could not persist term and vote: %v\", n.group, err)\n\t\treturn\n\t}\n\tvr := voteRequest{n.term, n.pterm, n.pindex, n.id, _EMPTY_}\n\tsubj, reply := n.vsubj, n.vreply\n\tn.Unlock()\n\n\tn.debug(\"Sending out voteRequest %+v\", vr)\n\n\t// Now send it out.\n\tn.sendRPC(subj, reply, vr.encode())\n}\n\nfunc (n *raft) sendRPC(subject, reply string, msg []byte) {\n\tn.t.Publish(subject, reply, msg)\n}\n\nfunc (n *raft) sendReply(subject string, msg []byte) {\n\tn.t.Publish(subject, _EMPTY_, msg)","sourceCodeStart":5676,"sourceCodeEnd":5712,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/raft.go#L5676-L5712","documentation":"A candidate could not durably persist its self-vote before campaigning (writeTermVote failed), so it resets its vote to noVote and abandons this vote-request round. This prevents the unsafe case of voting for itself, restarting, and voting for another node in the same term.","triggerScenarios":"Thrown at server/raft.go:5694 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Repair the storage issue preventing term_vote writes","The node remains candidate and will campaign again in a later timeout","Monitor for repeated failures which block this node from ever winning elections"],"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"}