{"record":{"id":"bb656d14a2bee81d","repo":"thanos-io/thanos","slug":"index-cache-with-type-s-is-not-supported","errorCode":null,"errorMessage":"index cache with type %s is not supported","messagePattern":"index cache with type (.+?) is not supported","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/store/cache/factory.go","lineNumber":75,"sourceCode":"\n\tvar cache IndexCache\n\tswitch strings.ToUpper(string(cacheConfig.Type)) {\n\tcase string(INMEMORY):\n\t\tcache, err = NewInMemoryIndexCache(logger, cacheMetrics, reg, backendConfig)\n\tcase string(MEMCACHED):\n\t\tvar memcached cacheutil.RemoteCacheClient\n\t\tmemcached, err = cacheutil.NewMemcachedClient(logger, \"index-cache\", backendConfig, reg)\n\t\tif err == nil {\n\t\t\tcache, err = NewRemoteIndexCache(logger, memcached, cacheMetrics, reg, cacheConfig.TTL)\n\t\t}\n\tcase string(REDIS):\n\t\tvar redisCache cacheutil.RemoteCacheClient\n\t\tredisCache, err = cacheutil.NewRedisClient(logger, \"index-cache\", backendConfig, reg)\n\t\tif err == nil {\n\t\t\tcache, err = NewRemoteIndexCache(logger, redisCache, cacheMetrics, reg, cacheConfig.TTL)\n\t\t}\n\tdefault:\n\t\treturn nil, errors.Errorf(\"index cache with type %s is not supported\", cacheConfig.Type)\n\t}\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, fmt.Sprintf(\"create %s index cache\", cacheConfig.Type))\n\t}\n\n\tcache = NewTracingIndexCache(string(cacheConfig.Type), cache)\n\tif len(cacheConfig.EnabledItems) > 0 {\n\t\tif err = ValidateEnabledItems(cacheConfig.EnabledItems); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcache = NewFilteredIndexCache(cache, cacheConfig.EnabledItems)\n\t}\n\n\treturn cache, nil\n}\n","sourceCodeStart":57,"sourceCodeEnd":91,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/store/cache/factory.go#L57-L91","documentation":"NewIndexCache dispatches on cacheConfig.Type against the supported backends (in-memory, memcached, etc.) and throws this error in the default case when the requested cache type has no registered factory. It means the type string in the index cache configuration is not one of the supported enum values.","triggerScenarios":"Passing an index-cache YAML with type set to an unknown value, e.g. type: redis in a build/version where redis is not compiled in, type: redis-cluster, a typo like in-memory-cache, or an empty type string.","commonSituations":"Copy-pasting cache config from another project (e.g. Cortex) that supports different cache types; upgrading/downgrading Thanos so a previously available backend disappears; typos in type name.","solutions":["Set type to a supported value: in-memory, memcached, or redis (depending on version).","Check the error message for the rejected value and compare to docs for your Thanos version.","If redis support is missing, upgrade Thanos to a version that includes the redis cache backend."],"exampleFix":"// before\nindex-cache:\n  type: redis-cluster\n// after\nindex-cache:\n  type: redis\n  config:\n    addresses: [\"redis:6379\"]","handlingStrategy":"validation","validationCode":"valid := map[string]bool{\"in-memory\": true, \"memcached\": true, \"redis\": true}\nvar cfg struct{ Type string `yaml:\"type\"` }\nif err := yaml.Unmarshal(confYaml, &cfg); err == nil && !valid[cfg.Type] {\n\treturn fmt.Errorf(\"unsupported index cache type %q; use in-memory, memcached or redis\", cfg.Type)\n}","typeGuard":null,"tryCatchPattern":"if _, err := storecache.NewIndexCache(logger, confYaml, reg); err != nil {\n\tvar unknown interface{ Error() string }\n\tif strings.Contains(err.Error(), \"is not supported\") {\n\t\treturn fmt.Errorf(\"index-cache.type must be one of in-memory|memcached|redis: %w\", err)\n\t}\n\treturn err\n}","preventionTips":["Whitelist cache type strings in your config CI.","Verify supported types against your Thanos version before upgrades.","Do not copy cache 'type' values from Cortex or other projects."],"tags":["config","cache","enum"],"backgroundTag":"invalid-enum-value","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"}