{"record":{"id":"0915fd0a7dbf3998","repo":"thanos-io/thanos","slug":"dir-symlink-eval","errorCode":null,"errorMessage":"dir symlink eval","messagePattern":"dir symlink eval","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/reloader/reloader.go","lineNumber":428,"sourceCode":"\t\tif err := hashFile(h, r.cfgFile); err != nil {\n\t\t\treturn errors.Wrap(err, \"hash file\")\n\t\t}\n\t\tcfgHash = h.Sum(nil)\n\t\tif r.cfgOutputFile != \"\" {\n\t\t\tif err := r.normalize(r.cfgFile, r.cfgOutputFile); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tcfgDirsHash := make([][]byte, len(r.cfgDirs))\n\tcfgDirsChanged := len(r.lastCfgDirsHash) == 0 && len(r.cfgDirs) > 0\n\tfor i, cfgDir := range r.cfgDirs {\n\t\th := sha256.New()\n\n\t\twalkDir, err := filepath.EvalSymlinks(cfgDir.Dir)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"dir symlink eval\")\n\t\t}\n\t\toutDir, err := filepath.EvalSymlinks(cfgDir.OutputDir)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"dir symlink eval\")\n\t\t}\n\n\t\tcfgDirFiles := map[string]struct{}{}\n\t\tentries, err := os.ReadDir(walkDir)\n\t\tif err != nil {\n\t\t\treturn errors.Wrapf(err, \"read dir: %s\", walkDir)\n\t\t}\n\t\tfor _, entry := range entries {\n\t\t\tpath := filepath.Join(walkDir, entry.Name())\n\n\t\t\t// Make sure to follow a symlink before checking if it is a directory.\n\t\t\ttargetFile, err := os.Stat(path)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrapf(err, \"stat file: %s\", path)","sourceCodeStart":410,"sourceCodeEnd":446,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/reloader/reloader.go#L410-L446","documentation":"apply fails when filepath.EvalSymlinks cannot resolve the watched rule directory or its output directory — the symlink is dangling or the directory was removed — so directory hashing and reload abort for this cycle.","triggerScenarios":"Thrown at pkg/reloader/reloader.go:428 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the rule directory symlink targets an existing path.","Re-create the mount/configmap if deleted.","Inspect the wrapped error to see which path failed."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"35b8b991177def87ed52dcf10f9b6d87f07282c8","analyzedAt":"2026-09-07T01:49:59.689Z","contentChangedAt":"2026-09-07T01:49:59.689Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}