{"record":{"id":"cb43486cf61380d0","repo":"thanos-io/thanos","slug":"invalid-resultscache-config-for-query-range-trippe","errorCode":null,"errorMessage":"invalid ResultsCache config for query_range tripperware","messagePattern":"invalid ResultsCache config for query_range tripperware","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/queryfrontend/config.go","lineNumber":272,"sourceCode":"\tSplitQueriesByInterval time.Duration\n\tMaxRetries             int\n\n\tLimits *cortexvalidation.Limits\n}\n\n// Validate a fully initialized config.\nfunc (cfg *Config) Validate() error {\n\tif cfg.QueryRangeConfig.ResultsCacheConfig != nil {\n\t\tif cfg.QueryRangeConfig.SplitQueriesByInterval <= 0 && !cfg.isDynamicSplitSet() {\n\t\t\treturn errors.New(\"split queries or split threshold interval should be greater than 0 when caching is enabled\")\n\t\t}\n\t\t// This is instantiated just to make the QFE config comply with validation against the Cortex Querier,\n\t\t// but in Thanos we don't use this configuration at all.\n\t\tignoredQueryConfig := querier.Config{\n\t\t\tEnablePerStepStats: cfg.QueryRangeConfig.ResultsCacheConfig.CacheQueryableSamplesStats,\n\t\t}\n\t\tif err := cfg.QueryRangeConfig.ResultsCacheConfig.Validate(ignoredQueryConfig); err != nil {\n\t\t\treturn errors.Wrap(err, \"invalid ResultsCache config for query_range tripperware\")\n\t\t}\n\t}\n\n\tif cfg.isDynamicSplitSet() && cfg.isStaticSplitSet() {\n\t\treturn errors.New(\"split queries interval and dynamic query split interval cannot be set at the same time\")\n\t}\n\n\tif cfg.isDynamicSplitSet() {\n\n\t\tif err := cfg.validateDynamicSplitParams(); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif cfg.LabelsConfig.ResultsCacheConfig != nil {\n\t\tif cfg.LabelsConfig.SplitQueriesByInterval <= 0 {\n\t\t\treturn errors.New(\"split queries interval should be greater than 0  when caching is enabled\")\n\t\t}","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/queryfrontend/config.go#L254-L290","documentation":"After the split check, Validate runs the Cortex ResultsCacheConfig.Validate against a stub querier.Config and wraps any failure with 'invalid ResultsCache config for query_range tripperware'. It indicates the underlying Cortex results-cache options for query_range are inconsistent (e.g. bad cache backend settings).","triggerScenarios":"cfg.QueryRangeConfig.ResultsCacheConfig.Validate(ignoredQueryConfig) returns an error — Cortex-level validation of the results cache config fails.","commonSituations":"Malformed cache backend options carried into the Cortex config, missing cache name/backend in the generated results-cache config, or version mismatch where Cortex added new required fields.","solutions":["Read the wrapped inner error for the precise Cortex validation failure and fix that option.","Regenerate the response-cache config file from a Thanos example matching your Thanos version.","Upgrade/align Thanos and Cortex versions if the config schema changed.","Temporarily disable the query_range results cache to confirm the rest of the config is fine."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// sanity-check the cache backend settings inside the results cache file before start\nif cachingEnabled {\n    if err := validateCacheBackend(cacheCfg); err != nil {\n        return fmt.Errorf(\"results cache backend invalid: %w\", err)\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := cfg.Validate(); err != nil {\n    if strings.Contains(err.Error(), \"invalid ResultsCache config for query_range tripperware\") {\n        return fmt.Errorf(\"fix inner Cortex results-cache option: %w\", err)\n    }\n    return err\n}","preventionTips":["Keep the results-cache config generated from version-matched examples.","Log full wrapped errors to expose the Cortex-level cause.","Pin Thanos version to keep the embedded Cortex schema stable."],"tags":["config","validation","caching","query-frontend"],"backgroundTag":"invalid-config-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"}