{"record":{"id":"9974fab34493b9cf","repo":"nats-io/nats-server","slug":"resource-not-found-v","errorCode":null,"errorMessage":"Resource not found: %v","messagePattern":"Resource not found: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/filestore.go","lineNumber":5458,"sourceCode":"\t\terrors.Is(err, errCorruptState) ||\n\t\terrors.Is(err, errPriorState) ||\n\t\terrors.Is(err, io.ErrUnexpectedEOF) ||\n\t\terrors.Is(err, errMsgBlkTooBig) ||\n\t\terrors.As(err, &badMsg)\n}\n\n// Lock should be held.\nfunc (fs *fileStore) setWriteErr(err error) {\n\tif fs.werr != nil {\n\t\treturn\n\t}\n\t// Ignore non-write errors.\n\tif err == ErrStoreClosed {\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\tfs.warn(\"Resource not found: %v\", err)\n\t\treturn\n\t}\n\t// Read/decode errors surfaced from existing on-disk data are not write failures.\n\t// Log and continue instead of disabling writes.\n\tif isReadErr(err) {\n\t\tfs.rateLimitWarn(\"Ignoring non-write error: %v\", err)\n\t\tassert.Unreachable(\"Filestore encountered read error\", map[string]any{\n\t\t\t\"name\":  fs.cfg.Name,\n\t\t\t\"err\":   err,\n\t\t\t\"stack\": string(debug.Stack()),\n\t\t})\n\t\treturn\n\t}\n\tfs.error(\"Critical write error: %v\", err)\n\tfs.werr = err\n\tassert.Unreachable(\"Filestore encountered write error\", map[string]any{\n\t\t\"name\":  fs.cfg.Name,\n\t\t\"err\":   err,","sourceCodeStart":5440,"sourceCodeEnd":5476,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/filestore.go#L5440-L5476","documentation":"A warning logged by fileStore.setWriteErr() when the reported error is a file-not-found condition (os.IsNotExist). Such errors are treated as a missing resource (e.g. a block or index file vanished) rather than a fatal write error, so the store logs and keeps running instead of disabling writes.","triggerScenarios":"Thrown at server/filestore.go:5458 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Identify which file was reported missing from the wrapped error path","Check whether files were manually deleted or an external process is tampering with the store directory","Restore from backup or recreate the stream if data is missing","Check mounts and disk health for the store directory"],"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"}