thanos-io/thanos · error

id matching is not supported

Error message

id matching is not supported

What it means

The DuplicatedCompactionBlocks verifier in pkg/verifier supports only whole-block ID-based repair workflows; its VerifyRepair returns this error whenever a non-nil idMatcher is supplied. ID matching (repairing only blocks whose ULID matches a predicate) is explicitly unsupported for the duplicated_compaction issue because repairs must process overlapping block groups together.

Solutions

  1. Re-run the verification without the id-matching option for the duplicated_compaction issue
  2. Use block-id based verification for other issues if selective repair is needed
  3. If selective repair of duplicates is required, handle overlapping groups manually with compaction tooling

Example fix

// before
thanos tools bucket verify --issue duplicated_compaction --id-matching
// after
thanos tools bucket verify --issue duplicated_compaction
Defensive patterns

Strategy: fallback

Validate before calling

// Only pass idMatcher for issues that support it
if issue == "duplicated_compaction" && idMatcher != nil {
    return fmt.Errorf("run duplicated_compaction verification without id matching")
}

Try / catch

if err := verifier.VerifyRepair(ctx, matcher, repair); err != nil {
    if strings.Contains(err.Error(), "id matching is not supported") {
        // retry without matcher
        return verifier.VerifyRepair(ctx, nil, repair)
    }
    return err
}

Prevention

When it happens

Trigger: Running the verifier (e.g. `thanos tools bucket verify --id-matching` style invocation or API call passing an idMatcher func) against issue 'duplicated_compaction'.

Common situations: Operators reusing a generic verify command with the id-matching flag for all issue types; duplicated compaction is one of the few issues that cannot be filtered that way.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of thanos-io/thanos@35b8b99117 (2026-09-07). Data as JSON: /api/errors/3b193020cac9d9fc. Report an issue: GitHub.

Appendix: source

Thrown at pkg/verifier/duplicated_compaction.go:29

	"github.com/go-kit/log/level"
	"github.com/oklog/ulid/v2"

	"github.com/pkg/errors"
	"github.com/prometheus/prometheus/tsdb"
)

// DuplicatedCompactionBlocks is for bug fixed in https://github.com/thanos-io/thanos/commit/94e26c63e52ba45b713fd998638d0e7b2492664f.
// Bug resulted in source block not being removed immediately after compaction, so we were compacting again and again same sources
// until sync-delay passes.
// The expected print of this are same overlapped blocks with exactly the same sources, time ranges and stats.
// If repair is enabled, all but one duplicates are safely deleted.
type DuplicatedCompactionBlocks struct{}

func (DuplicatedCompactionBlocks) IssueID() string { return "duplicated_compaction" }

func (DuplicatedCompactionBlocks) VerifyRepair(ctx Context, idMatcher func(ulid.ULID) bool, repair bool) error {
	if idMatcher != nil {
		return errors.Errorf("id matching is not supported")
	}

	level.Info(ctx.Logger).Log("msg", "started verifying issue", "with-repair", repair)

	overlaps, err := fetchOverlaps(ctx, ctx.Fetcher)
	if err != nil {
		return errors.Wrap(err, "fetch overlaps")
	}

	if len(overlaps) == 0 {
		// All good.
		return nil
	}

	// We have overlaps, let's see if they include exact duplicates. If yes, let's put them into distinct set.
	var (
		toKillLookup = map[ulid.ULID]struct{}{}
		toKill       []ulid.ULID

View on GitHub (pinned to 35b8b99117)