{"record":{"id":"f377ec446a685b10","repo":"thanos-io/thanos","slug":"unsupported-deduplication-func-got-s","errorCode":null,"errorMessage":"unsupported deduplication func, got %s","messagePattern":"unsupported deduplication func, got (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/thanos/compact.go","lineNumber":340,"sourceCode":"\tdefer func() {\n\t\tif rerr != nil {\n\t\t\tcancel()\n\t\t}\n\t}()\n\n\tvar mergeFunc storage.VerticalChunkSeriesMergeFunc\n\tswitch conf.dedupFunc {\n\tcase compact.DedupAlgorithmPenalty:\n\t\tmergeFunc = dedup.NewChunkSeriesMerger()\n\n\t\tif len(dedupReplicaLabels) == 0 {\n\t\t\treturn errors.New(\"penalty based deduplication needs at least one replica label specified\")\n\t\t}\n\tcase \"\":\n\t\tmergeFunc = storage.NewCompactingChunkSeriesMerger(storage.ChainedSeriesMerge)\n\n\tdefault:\n\t\treturn errors.Errorf(\"unsupported deduplication func, got %s\", conf.dedupFunc)\n\t}\n\n\t// Instantiate the compactor with different time slices. Timestamps in TSDB\n\t// are in milliseconds.\n\tcomp, err := tsdb.NewLeveledCompactor(ctx, reg, logutil.GoKitLogToSlog(logger), levels, downsample.NewPool(), mergeFunc)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"create compactor\")\n\t}\n\n\tvar (\n\t\tcompactDir      = path.Join(conf.dataDir, \"compact\")\n\t\tdownsamplingDir = path.Join(conf.dataDir, \"downsample\")\n\t)\n\n\tif err := os.MkdirAll(compactDir, os.ModePerm); err != nil {\n\t\treturn errors.Wrap(err, \"create working compact directory\")\n\t}\n","sourceCodeStart":322,"sourceCodeEnd":358,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/compact.go#L322-L358","documentation":"runCompact switches on conf.dedupFunc; any value other than \"penalty\" or \"\" (default) is rejected with this errors.Errorf naming the offending value. This guards against typos and removed dedup algorithms.","triggerScenarios":"Passing --deduplication.func with an unsupported value, e.g. \"penalty-replicaboost\", \"none\", or an algorithm removed in a newer Thanos.","commonSituations":"Typos of \"penalty\"; copying flags from documentation for other versions; experimenting with algorithms that were never released.","solutions":["Use --deduplication.func=penalty or omit the flag entirely (default chained merge).","Check `thanos compact --help` for supported dedup functions in your version.","Grep your deploy manifests for the invalid value and correct it."],"exampleFix":"// before\n--deduplication.func=penaltyv2\n// after\n--deduplication.func=penalty","handlingStrategy":"validation","validationCode":"valid := map[string]bool{\"\": true, \"penalty\": true}\nif !valid[dedupFunc] {\n    return fmt.Errorf(\"deduplication.func must be empty or penalty, got %q\", dedupFunc)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only use dedup funcs from `thanos compact --help` of your deployed version","Avoid hand-typing algorithm names; copy from official docs and lint manifests","Keep the dedup func consistent across compact and rule components"],"tags":["cli","enum-validation","deduplication"],"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"}