{"record":{"id":"4c53de37a4ae6bdb","repo":"thanos-io/thanos","slug":"unsupported-compression-type-s","errorCode":null,"errorMessage":"unsupported compression type: %s","messagePattern":"unsupported compression type: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cortex/querier/queryrange/results_cache.go","lineNumber":71,"sourceCode":"\tCacheConfig                cache.Config `yaml:\"cache\"`\n\tCompression                string       `yaml:\"compression\"`\n\tCacheQueryableSamplesStats bool         `yaml:\"cache_queryable_samples_stats\"`\n}\n\n// RegisterFlags registers flags.\nfunc (cfg *ResultsCacheConfig) RegisterFlags(f *flag.FlagSet) {\n\tcfg.CacheConfig.RegisterFlagsWithPrefix(\"frontend.\", \"\", f)\n\n\tf.StringVar(&cfg.Compression, \"frontend.compression\", \"\", \"Use compression in results cache. Supported values are: 'snappy' and '' (disable compression).\")\n\tf.BoolVar(&cfg.CacheQueryableSamplesStats, \"frontend.cache-queryable-samples-stats\", false, \"Cache Statistics queryable samples on results cache.\")\n}\n\nfunc (cfg *ResultsCacheConfig) Validate(qCfg querier.Config) error {\n\tswitch cfg.Compression {\n\tcase \"snappy\", \"\":\n\t\t// valid\n\tdefault:\n\t\treturn errors.Errorf(\"unsupported compression type: %s\", cfg.Compression)\n\t}\n\n\tif cfg.CacheQueryableSamplesStats && !qCfg.EnablePerStepStats {\n\t\treturn errors.New(\"frontend.cache-queryable-samples-stats may only be enabled in conjunction with querier.per-step-stats-enabled. Please set the latter\")\n\t}\n\n\treturn cfg.CacheConfig.Validate()\n}\n\n// Extractor is used by the cache to extract a subset of a response from a cache entry.\ntype Extractor interface {\n\t// Extract extracts a subset of a response from the `start` and `end` timestamps in milliseconds in the `from` response.\n\tExtract(start, end int64, from Response) Response\n\tExtractForStep(start, end, step int64, from Response) Response\n\tResponseWithoutHeaders(resp Response) Response\n\tResponseWithoutStats(resp Response) Response\n}\n","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/internal/cortex/querier/queryrange/results_cache.go#L53-L89","documentation":"ResultsCacheConfig.Validate rejects any cfg.Compression value other than \"snappy\" or empty string. The results-cache payload compression is limited to snappy; any other codec name is a config error surfaced at startup/validation time.","triggerScenarios":"Calling Config.Validate (or app startup) with `-querier.results-cache.compression` (yaml `compression`) set to something like \"gzip\", \"zstd\", or a typo such as \"snavy\".","commonSituations":"Copying config from another project that supports gzip cache compression; typos in the flag value; newer/older Cortex versions with different codec support.","solutions":["Set compression to \"snappy\" or remove the flag to use the default","Check `cortex -help` / config reference for supported compression values in your version","Correct typos in the compression flag value"],"exampleFix":"# before\nquerier:\n  results-cache:\n    compression: gzip\n# after\nquerier:\n  results-cache:\n    compression: snappy","handlingStrategy":"validation","validationCode":"if cfg.Compression != \"snappy\" && cfg.Compression != \"\" {\n\treturn fmt.Errorf(\"unsupported compression: %q, use snappy or unset\", cfg.Compression)\n}","typeGuard":null,"tryCatchPattern":"if err := cfg.Validate(qCfg); err != nil {\n\tif strings.Contains(err.Error(), \"unsupported compression\") {\n\t\tcfg.Compression = \"snappy\"\n\t}\n}","preventionTips":["Only use documented values: snappy or empty","Lint configs against the Cortex config reference for your version","Run cortex -config.file=... -config.expand-env with validation before deploy"],"tags":["config","validation","cache","compression","cortex"],"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"}