nats-io/nats-server · error

Resource not found: %v

Error message

Resource not found: %v

What it means

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.

Source

Thrown at server/filestore.go:5458

		errors.Is(err, errCorruptState) ||
		errors.Is(err, errPriorState) ||
		errors.Is(err, io.ErrUnexpectedEOF) ||
		errors.Is(err, errMsgBlkTooBig) ||
		errors.As(err, &badMsg)
}

// Lock should be held.
func (fs *fileStore) setWriteErr(err error) {
	if fs.werr != nil {
		return
	}
	// Ignore non-write errors.
	if err == ErrStoreClosed {
		return
	}
	// If this is a not found report but do not disable.
	if os.IsNotExist(err) {
		fs.warn("Resource not found: %v", err)
		return
	}
	// Read/decode errors surfaced from existing on-disk data are not write failures.
	// Log and continue instead of disabling writes.
	if isReadErr(err) {
		fs.rateLimitWarn("Ignoring non-write error: %v", err)
		assert.Unreachable("Filestore encountered read error", map[string]any{
			"name":  fs.cfg.Name,
			"err":   err,
			"stack": string(debug.Stack()),
		})
		return
	}
	fs.error("Critical write error: %v", err)
	fs.werr = err
	assert.Unreachable("Filestore encountered write error", map[string]any{
		"name":  fs.cfg.Name,
		"err":   err,

View on GitHub (pinned to 3a66a489d2)

Solutions

  1. Identify which file was reported missing from the wrapped error path
  2. Check whether files were manually deleted or an external process is tampering with the store directory
  3. Restore from backup or recreate the stream if data is missing
  4. Check mounts and disk health for the store directory
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at server/filestore.go:5458 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of nats-io/nats-server@3a66a489d2 (2026-09-02). Data as JSON: /api/errors/9974fab34493b9cf. Report an issue: GitHub.