{"record":{"id":"018034908c89a203","repo":"thanos-io/thanos","slug":"unable-to-create-config-reloader","errorCode":null,"errorMessage":"unable to create config reloader","messagePattern":"unable to create config reloader","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/thanos/endpointset.go","lineNumber":279,"sourceCode":"\n\tif err := extkingpin.PathContentReloader(context.Background(), configFile, logger, func() {\n\t\tres.mu.Lock()\n\t\tdefer res.mu.Unlock()\n\n\t\tlevel.Info(logger).Log(\"msg\", \"reloading endpoint config\")\n\t\tcfg, err := res.parse(configFile)\n\t\tif err != nil {\n\t\t\tlevel.Error(logger).Log(\"msg\", \"failed to reload endpoint config\", \"err\", err)\n\t\t\treturn\n\t\t}\n\t\tres.addStaticEndpoints(&cfg)\n\t\tif err := validateEndpointConfig(&cfg); err != nil {\n\t\t\tlevel.Error(logger).Log(\"msg\", \"failed to validate endpoint config\", \"err\", err)\n\t\t\treturn\n\t\t}\n\t\tres.cfg = cfg\n\t}, configReloadInterval); err != nil {\n\t\treturn nil, errors.Wrapf(err, \"unable to create config reloader\")\n\t}\n\treturn res, nil\n}\n\nfunc setupEndpointSet(\n\tg *run.Group,\n\tcomp component.Component,\n\treg prometheus.Registerer,\n\tlogger log.Logger,\n\tconfigFile fileContent,\n\tconfigReloadInterval time.Duration,\n\tlegacyFileSDFiles []string,\n\tlegacyFileSDInterval time.Duration,\n\tlegacyEndpoints []string,\n\tlegacyEndpointGroups []string,\n\tlegacyStrictEndpoints []string,\n\tlegacyStrictEndpointGroups []string,\n\tdnsSDResolver string,","sourceCodeStart":261,"sourceCodeEnd":297,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/endpointset.go#L261-L297","documentation":"Raised when the background config-file reloader (extconfig.NewRelacer-style watcher over the endpoint config) cannot be created. The reloader watches the endpoint config file and re-parses/validates it on change; if its construction fails (e.g., no path to watch or watcher setup error), provider creation fails with this wrapper.","triggerScenarios":"newEndpointConfigProvider calls the reloader constructor with the config file path and update callback; constructor returns error because the file path is empty/invalid for watching or the filesystem watcher (fsnotify) fails to initialize.","commonSituations":"Passing an endpoint-config flag on a filesystem that doesn't support inotify (some NFS/network mounts); misconfigured reload interval (<=0) accepted by flags but rejected by reloader;Thanos binary built without fsnotify support.","solutions":["Check the chained error; ensure the config file path passed to --endpoint-config is absolute and exists so the watcher can attach.","Avoid watching files on NFS/tmpfs; copy the config to a local path or use static --endpoint flags instead.","Verify --endpoint-config-reload-interval (configReloadInterval) is a positive duration.","Test fsnotify on the target filesystem; if unsupported, run Thanos with a local bind-mounted copy of the config."],"exampleFix":"// before\nreloader, err := extconfig.NewRelacer(configFile, logger, reg, func(f *file.Content) { ... })\nif err != nil { return nil, errors.Wrapf(err, \"unable to create config reloader\") }\n// after: skip watcher when path is not watchable\nif _, err := os.Stat(configFile.Path()); err == nil && isLocalFS(configFile.Path()) {\n    reloader, err = extconfig.NewRelacer(configFile, logger, reg, onUpdate)\n    if err != nil { return nil, errors.Wrapf(err, \"unable to create config reloader\") }\n}","handlingStrategy":"fallback","validationCode":"if _, err := os.Stat(configFile.Path()); err != nil { return errors.Wrap(err, \"endpoint config must exist to create reloader\") }","typeGuard":"func watchable(p string) bool { return p != \"\" && isLocalFilesystem(p) }","tryCatchPattern":"res, err := newEndpointConfigProvider(...)\nif err != nil && strings.Contains(err.Error(), \"unable to create config reloader\") {\n    logger.Warn(\"falling back to static endpoints without reload\")\n    res = staticProvider\n}","preventionTips":["Keep endpoint config on a local filesystem supporting inotify.","Ensure reload interval is a positive duration.","Verify fsnotify works in your container runtime (mount propagation).","Have a static-endpoint fallback configuration ready."],"tags":["config","file-watcher","thanos","startup"],"backgroundTag":"file-watch-failed","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"}