{"record":{"id":"5616c75bb1037810","repo":"thanos-io/thanos","slug":"unable-to-validate-endpoints","errorCode":null,"errorMessage":"unable to validate endpoints","messagePattern":"unable to validate endpoints","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/thanos/endpointset.go","lineNumber":253,"sourceCode":") (*endpointConfigProvider, error) {\n\tres := &endpointConfigProvider{\n\t\tendpoints:            staticEndpoints,\n\t\tendpointGroups:       staticEndpointGroups,\n\t\tstrictEndpoints:      staticStrictEndpoints,\n\t\tstrictEndpointGroups: staticStrictEndpointGroups,\n\t}\n\n\tif configFile == nil {\n\t\tconfigFile = extkingpin.NewNopConfig()\n\t}\n\n\tcfg, err := res.parse(configFile)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"unable to load config file\")\n\t}\n\tres.addStaticEndpoints(&cfg)\n\tif err := validateEndpointConfig(&cfg); err != nil {\n\t\treturn nil, errors.Wrapf(err, \"unable to validate endpoints\")\n\t}\n\tres.cfg = cfg\n\n\t// only static endpoints\n\tif len(configFile.Path()) == 0 {\n\t\treturn res, nil\n\t}\n\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}","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/endpointset.go#L235-L271","documentation":"Wrapper raised in newEndpointConfigProvider when validateEndpointConfig rejects the initially parsed endpoint configuration. Validation covers strict-mode rules (no SD endpoints), service_config only for groups, and per-endpoint client compression checks. The specific rule violation is chained beneath this message.","triggerScenarios":"The config contains a dynamic (SD-based) endpoint while --endpoint-strict-mode is enabled; service_config set on a non-group endpoint; or an endpoint's ClientConfig fails validateCompression.","commonSituations":"Operator enables strict mode but keeps file-SD endpoints in the config; adds service_config to a plain endpoint entry; compression settings unsupported by peers or invalid values.","solutions":["Read the chained error to find the offending endpoint address and rule; fix that entry (remove SD endpoints under strict mode, or disable strict mode).","Move service_config onto endpoint group entries only.","Fix or drop the endpoint's client_config compression settings per validateCompression rules.","Validate the config file offline before deploy (same YAML against the EndpointConfig schema + rules)."],"exampleFix":"// before: strict mode with SD endpoint\n// endpoints:\n//   - address: dnssrv+_grpc._tcp.stores:10901\n// after: use group or static address\n// endpoint_groups:\n//   - address: dnssrv+_grpc._tcp.stores:10901\n//     group: true","handlingStrategy":"validation","validationCode":"if strictMode { for _, e := range cfg.Endpoints { if strings.HasPrefix(e.Address, \"dnssrv\") || strings.Contains(e.Address, \"/\") { return fmt.Errorf(\"SD endpoint %s not allowed in strict mode\", e.Address) } } }","typeGuard":null,"tryCatchPattern":"_, err := newEndpointConfigProvider(...)\nif err != nil && strings.Contains(err.Error(), \"unable to validate endpoints\") {\n    log.Fatalf(\"endpoint config validation failed: %v\", err)\n}","preventionTips":["Document strict-mode rules for operators; validate before enabling the flag.","Only set service_config on endpoint group entries.","Dry-run validation locally with the same Thanos version.","Keep endpoint entries minimal; drop unused client_config fields."],"tags":["config","validation","strict-mode","thanos"],"backgroundTag":"schema-validation-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"}