thanos-io/thanos · error

get relabel configuration

Error message

get relabel configuration

What it means

The relabel configuration supplied to receive (via --relabel-config-file/--relabel-config) failed to parse or validate. Receive aborts startup because an invalid relabel config would corrupt ingestion routing.

Solutions

  1. Fix the relabel config YAML and action names
  2. Validate the config with promtool or a minimal test
  3. Check for unsupported relabel actions
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at cmd/thanos/receive.go:228 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at cmd/thanos/receive.go:228

	if enableIngestion {
		if err := os.MkdirAll(conf.dataDir, 0o755); err != nil {
			return errors.Wrapf(err, "create data dir in %v", conf.dataDir)
		}

		dataDir, err = os.OpenRoot(conf.dataDir)
		if err != nil {
			return errors.Wrap(err, "open storage dir")
		}

		// Create TSDB for the default tenant.
		if err := createDefautTenantTSDB(logger, conf.defaultTenantID, dataDir); err != nil {
			return errors.Wrapf(err, "create default tenant tsdb in %v", conf.dataDir)
		}
	}

	relabelConfig, err := conf.relabelCfg.RelabelConfig(nil)
	if err != nil {
		return errors.Wrap(err, "get relabel configuration")
	}

	var cache = storecache.NoopMatchersCache
	if conf.matcherCacheSize > 0 {
		cache, err = storecache.NewMatchersCache(storecache.WithSize(conf.matcherCacheSize), storecache.WithPromRegistry(reg))
		if err != nil {
			return errors.Wrap(err, "failed to create matchers cache")
		}
		multiTSDBOptions = append(multiTSDBOptions, receive.WithMatchersCache(cache))
	}

	multiTSDBOptions = append(multiTSDBOptions, receive.WithUploadConcurrency(conf.uploadConcurrency))

	dbs := receive.NewMultiTSDB(
		dataDir,
		logger,
		reg,
		tsdbOpts,

View on GitHub (pinned to 35b8b99117)