thanos-io/thanos · error

get content of index cache configuration

Error message

get content of index cache configuration

What it means

Wraps a failure of conf.indexCacheConfigs.Content(), which reads and decodes the index cache configuration file referenced by --store.index-cache.config. It fires when the file cannot be read from disk or its content fails validation before the index cache is constructed.

Solutions

  1. Check --index-cache.config-file path and permissions
  2. Validate the config file content
  3. Provide in-memory index cache flags instead if desired
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at cmd/thanos/store.go:358 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/16d26431083661e1. Report an issue: GitHub.

Appendix: source

Thrown at cmd/thanos/store.go:358

	}

	r := route.New()

	if len(cachingBucketConfigYaml) > 0 {
		insBkt, err = storecache.NewCachingBucketFromYaml(cachingBucketConfigYaml, insBkt, logger, reg, r, conf.cachingBucketConfig.Path())
		if err != nil {
			return errors.Wrap(err, "create caching bucket")
		}
	}

	relabelConfig, err := conf.selectorRelabel.RelabelConfig(block.SelectorSupportedRelabelActions)
	if err != nil {
		return err
	}

	indexCacheContentYaml, err := conf.indexCacheConfigs.Content()
	if err != nil {
		return errors.Wrap(err, "get content of index cache configuration")
	}

	// Create the index cache loading its config from config file, while keeping
	// backward compatibility with the pre-config file era.
	var indexCache storecache.IndexCache
	if len(indexCacheContentYaml) > 0 {
		indexCache, err = storecache.NewIndexCache(logger, indexCacheContentYaml, reg)
	} else {
		indexCache, err = storecache.NewInMemoryIndexCacheWithConfig(logger, nil, reg, storecache.InMemoryIndexCacheConfig{
			MaxSize:     model.Bytes(conf.indexCacheSizeBytes),
			MaxItemSize: storecache.DefaultInMemoryIndexCacheConfig.MaxItemSize,
		})
	}
	if err != nil {
		return errors.Wrap(err, "create index cache")
	}

	var matchersCache = storecache.NoopMatchersCache

View on GitHub (pinned to 35b8b99117)