nats-io/nats-server · error

error accessing path [%s]: %v

Error message

error accessing path [%s]: %v

What it means

Directory JWT store path validation: os.Stat failed with an error other than not-exist (e.g. permission denied on a parent directory), so existence could not even be determined for the path.

Source

Thrown at server/dirstore.go:55

)

// validatePathExists checks that the provided path exists and is a dir if requested
func validatePathExists(path string, dir bool) (string, error) {
	if path == _EMPTY_ {
		return _EMPTY_, errors.New("path is not specified")
	}

	abs, err := filepath.Abs(path)
	if err != nil {
		return _EMPTY_, fmt.Errorf("error parsing path [%s]: %v", abs, err)
	}

	var finfo os.FileInfo
	if finfo, err = os.Stat(abs); err != nil {
		if os.IsNotExist(err) {
			return _EMPTY_, fmt.Errorf("the path [%s] doesn't exist", abs)
		}
		return _EMPTY_, fmt.Errorf("error accessing path [%s]: %v", abs, err)
	}

	mode := finfo.Mode()
	if dir && mode.IsRegular() {
		return _EMPTY_, fmt.Errorf("the path [%s] is not a directory", abs)
	}

	if !dir && mode.IsDir() {
		return _EMPTY_, fmt.Errorf("the path [%s] is not a file", abs)
	}

	return abs, nil
}

// ValidateDirPath checks that the provided path exists and is a dir
func validateDirPath(path string) (string, error) {
	return validatePathExists(path, true)
}

View on GitHub (pinned to 3a66a489d2)

Solutions

  1. Check filesystem permissions on the path and its parents
  2. Mount or repair the affected filesystem
  3. Run the server with sufficient privileges to stat the path
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at server/dirstore.go:55 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/df8a423f15bb2670. Report an issue: GitHub.