{"record":{"id":"16d26431083661e1","repo":"thanos-io/thanos","slug":"get-content-of-index-cache-configuration","errorCode":null,"errorMessage":"get content of index cache configuration","messagePattern":"get content of index cache configuration","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/thanos/store.go","lineNumber":358,"sourceCode":"\t}\n\n\tr := route.New()\n\n\tif len(cachingBucketConfigYaml) > 0 {\n\t\tinsBkt, err = storecache.NewCachingBucketFromYaml(cachingBucketConfigYaml, insBkt, logger, reg, r, conf.cachingBucketConfig.Path())\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"create caching bucket\")\n\t\t}\n\t}\n\n\trelabelConfig, err := conf.selectorRelabel.RelabelConfig(block.SelectorSupportedRelabelActions)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tindexCacheContentYaml, err := conf.indexCacheConfigs.Content()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"get content of index cache configuration\")\n\t}\n\n\t// Create the index cache loading its config from config file, while keeping\n\t// backward compatibility with the pre-config file era.\n\tvar indexCache storecache.IndexCache\n\tif len(indexCacheContentYaml) > 0 {\n\t\tindexCache, err = storecache.NewIndexCache(logger, indexCacheContentYaml, reg)\n\t} else {\n\t\tindexCache, err = storecache.NewInMemoryIndexCacheWithConfig(logger, nil, reg, storecache.InMemoryIndexCacheConfig{\n\t\t\tMaxSize:     model.Bytes(conf.indexCacheSizeBytes),\n\t\t\tMaxItemSize: storecache.DefaultInMemoryIndexCacheConfig.MaxItemSize,\n\t\t})\n\t}\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"create index cache\")\n\t}\n\n\tvar matchersCache = storecache.NoopMatchersCache","sourceCodeStart":340,"sourceCodeEnd":376,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/store.go#L340-L376","documentation":"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.","triggerScenarios":"Thrown at cmd/thanos/store.go:358 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check --index-cache.config-file path and permissions","Validate the config file content","Provide in-memory index cache flags instead if desired"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}