{"record":{"id":"44ca3aea51661790","repo":"nats-io/nats-server","slug":"got-error-on-apply-commit-during-replay-v","errorCode":null,"errorMessage":"Got error on apply commit during replay: %v","messagePattern":"Got error on apply commit during replay: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/raft.go","lineNumber":1429,"sourceCode":"func (n *raft) ResumeApply() {\n\tn.Lock()\n\tdefer n.Unlock()\n\n\tif !n.paused {\n\t\treturn\n\t}\n\n\tn.debug(\"Resuming our apply channel\")\n\n\t// Reset before we start.\n\tn.resetElectionTimeout()\n\n\t// Run catchup..\n\tif n.hcommit > n.commit {\n\t\tn.debug(\"Resuming %d replays\", n.hcommit+1-n.commit)\n\t\tfor index := n.commit + 1; index <= n.hcommit; index++ {\n\t\t\tif err := n.applyCommit(index); err != nil {\n\t\t\t\tn.warn(\"Got error on apply commit during replay: %v\", err)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t// We want to unlock here to allow the upper layers to call Applied() without blocking.\n\t\t\tn.Unlock()\n\t\t\t// Give hint to let other Go routines run.\n\t\t\t// Might not be necessary but seems to make it more fine grained interleaving.\n\t\t\truntime.Gosched()\n\t\t\t// Simply re-acquire\n\t\t\tn.Lock()\n\t\t\t// Need to check if we got closed.\n\t\t\tif n.State() == Closed {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\t// Clear our paused state after we apply.\n\tn.paused = false","sourceCodeStart":1411,"sourceCodeEnd":1447,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/raft.go#L1411-L1447","documentation":"A warning logged by ResumeApply() when applyCommit() fails while replaying committed-but-unapplied entries during a catch-up. The replay loop breaks on the first error, leaving the node's applied index short of its committed index; this usually indicates WAL read/decode problems for that entry.","triggerScenarios":"Thrown at server/raft.go:1429 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped applyCommit error for WAL corruption at the failing index","Restore the WAL or catch up from a peer snapshot/entries","Call ResumeApply() again after fixing storage issues to continue replay"],"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-08T10:18:20.063Z"}