{"record":{"id":"26ae256df8ea7856","repo":"nats-io/nats-server","slug":"the-path-s-is-not-a-directory","errorCode":null,"errorMessage":"the path [%s] is not a directory","messagePattern":"the path \\[(.+?)\\] is not a directory","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/dirstore.go","lineNumber":60,"sourceCode":"\t\treturn _EMPTY_, errors.New(\"path is not specified\")\n\t}\n\n\tabs, err := filepath.Abs(path)\n\tif err != nil {\n\t\treturn _EMPTY_, fmt.Errorf(\"error parsing path [%s]: %v\", abs, err)\n\t}\n\n\tvar finfo os.FileInfo\n\tif finfo, err = os.Stat(abs); err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn _EMPTY_, fmt.Errorf(\"the path [%s] doesn't exist\", abs)\n\t\t}\n\t\treturn _EMPTY_, fmt.Errorf(\"error accessing path [%s]: %v\", abs, err)\n\t}\n\n\tmode := finfo.Mode()\n\tif dir && mode.IsRegular() {\n\t\treturn _EMPTY_, fmt.Errorf(\"the path [%s] is not a directory\", abs)\n\t}\n\n\tif !dir && mode.IsDir() {\n\t\treturn _EMPTY_, fmt.Errorf(\"the path [%s] is not a file\", abs)\n\t}\n\n\treturn abs, nil\n}\n\n// ValidateDirPath checks that the provided path exists and is a dir\nfunc validateDirPath(path string) (string, error) {\n\treturn validatePathExists(path, true)\n}\n\n// JWTChanged functions are called when the store file watcher notices a JWT changed\ntype JWTChanged func(publicKey string)\n\n// DirJWTStore implements the JWT Store interface, keeping JWTs in an optionally sharded","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/dirstore.go#L42-L78","documentation":"Directory JWT store path validation: the path exists but its mode is a regular file while a directory was required (dir=true), e.g. the resolver store path points at a file.","triggerScenarios":"Thrown at server/dirstore.go:60 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Point the store at a directory","Remove the file blocking directory creation","Fix the configuration value"],"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-08T10:18:20.063Z"}