{"record":{"id":"04c0e7a7c8e5ffe1","repo":"thanos-io/thanos","slug":"failed-to-initialize-config-watcher","errorCode":null,"errorMessage":"failed to initialize config watcher","messagePattern":"failed to initialize config watcher","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/thanos/receive.go","lineNumber":604,"sourceCode":"\tconf *receiveConfig,\n\thashringChangedChan chan struct{},\n\twebHandler *receive.Handler,\n\tstatusProber prober.Probe,\n\tenableIngestion bool,\n\tdbs *receive.MultiTSDB,\n) error {\n\t// Note: the hashring configuration watcher\n\t// is the sender and thus closes the chan.\n\t// In the single-node case, which has no configuration\n\t// watcher, we close the chan ourselves.\n\tupdates := make(chan []receive.HashringConfig, 1)\n\talgorithm := receive.HashringAlgorithm(conf.hashringsAlgorithm)\n\n\t// The Hashrings config file path is given initializing config watcher.\n\tif conf.hashringsFilePath != \"\" {\n\t\tcw, err := receive.NewConfigWatcher(log.With(logger, \"component\", \"config-watcher\"), reg, conf.hashringsFilePath, *conf.refreshInterval)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"failed to initialize config watcher\")\n\t\t}\n\n\t\t// Check the hashring configuration on before running the watcher.\n\t\tif err := cw.ValidateConfig(); err != nil {\n\t\t\tcw.Stop()\n\t\t\tclose(updates)\n\t\t\treturn errors.Wrap(err, \"failed to validate hashring configuration file\")\n\t\t}\n\n\t\tctx, cancel := context.WithCancel(context.Background())\n\t\tg.Add(func() error {\n\t\t\treturn receive.ConfigFromWatcher(ctx, updates, cw)\n\t\t}, func(error) {\n\t\t\tcancel()\n\t\t})\n\t} else {\n\t\tvar (\n\t\t\tcf  []receive.HashringConfig","sourceCodeStart":586,"sourceCodeEnd":622,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/receive.go#L586-L622","documentation":"receive.NewConfigWatcher failed while initializing the hashring file watcher, e.g. the --hashrings-file path does not exist or is unreadable. Without the watcher receive cannot learn hashring updates.","triggerScenarios":"Thrown at cmd/thanos/receive.go:604 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify --hashrings-file points to an existing readable file","Check file permissions and mount availability","Validate the hashring file content separately"],"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"}