thanos-io/thanos · error

response cache with type

Error message

response cache with type %s is not supported

What it means

NewCacheConfig switches on the configured cache type (INMEMORY, MEMCACHED, REDIS). Any other value reaches the default branch and returns 'response cache with type %s is not supported'. Thanos only supports these three response-cache backends for the query frontend.

Solutions

  1. Set type to one of: INMEMORY, MEMCACHED, REDIS (case-insensitive).
  2. Check spelling and exact backend names in the Thanos query-frontend cache docs.
  3. If you need another backend, use a supported one or contribute a provider; Cortex-only backends are not wired in Thanos.

Example fix

# before
type: BIGCACHE
# after
type: INMEMORY
Defensive patterns

Strategy: validation

Validate before calling

var p struct{ Type string `yaml:"type"` }
_ = yaml.Unmarshal(data, &p)
switch strings.ToUpper(p.Type) {
case "INMEMORY", "MEMCACHED", "REDIS":
default:
    return fmt.Errorf("unsupported cache type %q; use INMEMORY, MEMCACHED or REDIS", p.Type)
}

Try / catch

_, err := queryfrontend.NewCacheConfig(logger, yamlBytes)
if err != nil && strings.Contains(err.Error(), "is not supported") {
    return fmt.Errorf("fix cache type; see docs: %w", err)
}

Prevention

When it happens

Trigger: CacheProviderConfig.Type in the YAML (compared via strings.ToUpper) is not INMEMORY, MEMCACHED, or REDIS — e.g. a misspelled backend or one supported in Cortex but not Thanos.

Common situations: Typo like 'memcache' or 'in_memory', copying a Cortex cache config with unsupported backends, or assuming bigcache/other Cortex backends work in Thanos.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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

Appendix: source

Thrown at pkg/queryfrontend/config.go:181

		return &cortexcache.Config{
			Redis: cortexcache.RedisConfig{
				Endpoint:           config.Redis.Addr,
				Timeout:            config.Redis.ReadTimeout,
				MasterName:         config.Redis.MasterName,
				Expiration:         config.Expiration,
				DB:                 config.Redis.DB,
				Password:           flagext.Secret{Value: config.Redis.Password},
				Username:           config.Redis.Username,
				EnableTLS:          config.Redis.TLSEnabled,
				InsecureSkipVerify: config.Redis.TLSConfig.InsecureSkipVerify,
			},
			Background: cortexcache.BackgroundConfig{
				WriteBackBuffer:     config.Redis.MaxSetMultiConcurrency * config.Redis.SetMultiBatchSize,
				WriteBackGoroutines: config.Redis.MaxSetMultiConcurrency,
			},
		}, nil
	default:
		return nil, errors.Errorf("response cache with type %s is not supported", cacheConfig.Type)
	}
}

// DownstreamTripperConfig stores the http.Transport configuration for query-frontend's HTTP downstream tripper.
type DownstreamTripperConfig struct {
	IdleConnTimeout       prommodel.Duration `yaml:"idle_conn_timeout"`
	ResponseHeaderTimeout prommodel.Duration `yaml:"response_header_timeout"`
	TLSHandshakeTimeout   prommodel.Duration `yaml:"tls_handshake_timeout"`
	ExpectContinueTimeout prommodel.Duration `yaml:"expect_continue_timeout"`
	MaxIdleConns          *int               `yaml:"max_idle_conns"`
	MaxIdleConnsPerHost   *int               `yaml:"max_idle_conns_per_host"`
	MaxConnsPerHost       *int               `yaml:"max_conns_per_host"`
	TLSConfig             *exthttp.TLSConfig `yaml:"tls_config"`

	CachePathOrContent extflag.PathOrContent
}

// Config holds the query frontend configs.

View on GitHub (pinned to 35b8b99117)