{"record":{"id":"a9a56b556d799292","repo":"thanos-io/thanos","slug":"failed-to-validate-hashring-configuration-file","errorCode":null,"errorMessage":"failed to validate hashring configuration file","messagePattern":"failed to validate hashring configuration file","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/thanos/receive.go","lineNumber":611,"sourceCode":"\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\n\t\t\terr error\n\t\t)\n\t\t// The Hashrings config file content given initialize configuration from content.\n\t\tif len(conf.hashringsFileContent) > 0 {\n\t\t\tcf, err = receive.ParseConfig([]byte(conf.hashringsFileContent))\n\t\t\tif err != nil {\n\t\t\t\tclose(updates)","sourceCodeStart":593,"sourceCodeEnd":629,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/receive.go#L593-L629","documentation":"Wraps a failure of receive.NewConfigWatcher, which validates and starts watching the hashring configuration file given by --receive.hashrings-file. It fires when the file cannot be stat'ed, read, or does not conform to the hashring JSON schema; the multi-node receive setup aborts because it cannot track hashring membership changes.","triggerScenarios":"Thrown at cmd/thanos/receive.go:611 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix hashring JSON structure (hashrings array, endpoints)","Validate with the hashring config schema","Check for trailing commas or wrong types"],"exampleFix":null,"handlingStrategy":"validation","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"}