{"record":{"id":"a45f77a928b46012","repo":"nats-io/nats-server","slug":"resource-not-found-v-a45f77","errorCode":null,"errorMessage":"Resource not found: %v","messagePattern":"Resource not found: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/raft.go","lineNumber":5470,"sourceCode":"\t// Check if we are closed already.\n\tif n.State() == Closed {\n\t\treturn\n\t}\n\t// Ignore if already set.\n\tif n.werr == err || err == nil {\n\t\treturn\n\t}\n\t// Ignore non-write errors.\n\tif err == ErrStoreClosed ||\n\t\terr == ErrStoreEOF ||\n\t\terr == ErrStoreMsgNotFound ||\n\t\terr == errNoPending ||\n\t\terr == errPartialCache {\n\t\treturn\n\t}\n\t// If this is a not found report but do not disable.\n\tif os.IsNotExist(err) {\n\t\tn.warn(\"Resource not found: %v\", err)\n\t\treturn\n\t}\n\tn.error(\"Critical write error: %v\", err)\n\tn.werr = err\n\t// Abort any inflight async snapshot checkpoint.\n\tn.snapshotting = false\n\tn.shutdown()\n\tassert.Unreachable(\"Raft encountered write error\", map[string]any{\n\t\t\"n.accName\": n.accName,\n\t\t\"n.group\":   n.group,\n\t\t\"n.id\":      n.id,\n\t\t\"err\":       err,\n\t})\n\n\tif isPermissionError(err) {\n\t\tgo n.s.handleWritePermissionError()\n\t}\n","sourceCodeStart":5452,"sourceCodeEnd":5488,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/raft.go#L5452-L5488","documentation":"Inside setWriteErr, an incoming error matched os.IsNotExist. A missing file is treated as a recoverable condition: it is logged but does NOT latch werr or shut the node down, unlike critical write errors which disable the store and abort snapshotting.","triggerScenarios":"Thrown at server/raft.go:5470 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify no external process is deleting files under the store directory","If the missing file is a WAL/block, expect the normal recovery paths to rebuild or re-sync it","No shutdown is triggered; monitor whether a critical write error follows"],"exampleFix":null,"handlingStrategy":"validation","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"}