thanos-io/thanos · error

unable to validate endpoints

Error message

unable to validate endpoints

What it means

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.

Solutions

  1. 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).
  2. Move service_config onto endpoint group entries only.
  3. Fix or drop the endpoint's client_config compression settings per validateCompression rules.
  4. Validate the config file offline before deploy (same YAML against the EndpointConfig schema + rules).

Example fix

// before: strict mode with SD endpoint
// endpoints:
//   - address: dnssrv+_grpc._tcp.stores:10901
// after: use group or static address
// endpoint_groups:
//   - address: dnssrv+_grpc._tcp.stores:10901
//     group: true
Defensive patterns

Strategy: validation

Validate before calling

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) } } }

Try / catch

_, err := newEndpointConfigProvider(...)
if err != nil && strings.Contains(err.Error(), "unable to validate endpoints") {
    log.Fatalf("endpoint config validation failed: %v", err)
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of thanos-io/thanos@35b8b99117 (2026-09-07). Data as JSON: /api/errors/5616c75bb1037810. Report an issue: GitHub.

Appendix: source

Thrown at cmd/thanos/endpointset.go:253

) (*endpointConfigProvider, error) {
	res := &endpointConfigProvider{
		endpoints:            staticEndpoints,
		endpointGroups:       staticEndpointGroups,
		strictEndpoints:      staticStrictEndpoints,
		strictEndpointGroups: staticStrictEndpointGroups,
	}

	if configFile == nil {
		configFile = extkingpin.NewNopConfig()
	}

	cfg, err := res.parse(configFile)
	if err != nil {
		return nil, errors.Wrapf(err, "unable to load config file")
	}
	res.addStaticEndpoints(&cfg)
	if err := validateEndpointConfig(&cfg); err != nil {
		return nil, errors.Wrapf(err, "unable to validate endpoints")
	}
	res.cfg = cfg

	// only static endpoints
	if len(configFile.Path()) == 0 {
		return res, nil
	}

	if err := extkingpin.PathContentReloader(context.Background(), configFile, logger, func() {
		res.mu.Lock()
		defer res.mu.Unlock()

		level.Info(logger).Log("msg", "reloading endpoint config")
		cfg, err := res.parse(configFile)
		if err != nil {
			level.Error(logger).Log("msg", "failed to reload endpoint config", "err", err)
			return
		}

View on GitHub (pinned to 35b8b99117)