thanos-io/thanos · error
unsupported deduplication func, got
Error message
unsupported deduplication func, got %s
What it means
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.
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.
Example fix
// before --deduplication.func=penaltyv2 // after --deduplication.func=penalty
Defensive patterns
Strategy: validation
Validate before calling
valid := map[string]bool{"": true, "penalty": true}
if !valid[dedupFunc] {
return fmt.Errorf("deduplication.func must be empty or penalty, got %q", dedupFunc)
} Prevention
- 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
When it happens
Trigger: Passing --deduplication.func with an unsupported value, e.g. "penalty-replicaboost", "none", or an algorithm removed in a newer Thanos.
Common situations: Typos of "penalty"; copying flags from documentation for other versions; experimenting with algorithms that were never released.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- unknown sync strategy
- penalty based deduplication needs at least one replica…
- level is bigger then default set of
- get compaction levels
- unrecognized label
AI-assisted analysis of thanos-io/thanos@35b8b99117 (2026-09-07).
Data as JSON: /api/errors/f377ec446a685b10.
Report an issue: GitHub.
Appendix: source
Thrown at cmd/thanos/compact.go:340
defer func() {
if rerr != nil {
cancel()
}
}()
var mergeFunc storage.VerticalChunkSeriesMergeFunc
switch conf.dedupFunc {
case compact.DedupAlgorithmPenalty:
mergeFunc = dedup.NewChunkSeriesMerger()
if len(dedupReplicaLabels) == 0 {
return errors.New("penalty based deduplication needs at least one replica label specified")
}
case "":
mergeFunc = storage.NewCompactingChunkSeriesMerger(storage.ChainedSeriesMerge)
default:
return errors.Errorf("unsupported deduplication func, got %s", conf.dedupFunc)
}
// Instantiate the compactor with different time slices. Timestamps in TSDB
// are in milliseconds.
comp, err := tsdb.NewLeveledCompactor(ctx, reg, logutil.GoKitLogToSlog(logger), levels, downsample.NewPool(), mergeFunc)
if err != nil {
return errors.Wrap(err, "create compactor")
}
var (
compactDir = path.Join(conf.dataDir, "compact")
downsamplingDir = path.Join(conf.dataDir, "downsample")
)
if err := os.MkdirAll(compactDir, os.ModePerm); err != nil {
return errors.Wrap(err, "create working compact directory")
}
View on GitHub (pinned to 35b8b99117)