thanos-io/thanos · error

ignore function

Error message

ignore function

What it means

sanitizeChunkSequence failed while applying an ignore function (dedup/outside-chunk filter) to the chunk sequence during rewrite; the wrapped error comes from IgnoreDuplicateOutsideChunk or similar, aborting the block rewrite.

Solutions

  1. Look at the wrapped ignore-function error for the exact chunk conflict
  2. Fix underlying duplicated/corrupt chunks first
  3. Retry repair after resolving
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at pkg/block/index.go:554 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at pkg/block/index.go:554

	sort.Slice(chks, func(i, j int) bool {
		return chks[i].MinTime < chks[j].MinTime
	})

	// Remove duplicates, complete outsiders and near outsiders.
	repl := make([]chunks.Meta, 0, len(chks))
	var last *chunks.Meta

OUTER:
	// This compares the current chunk to the chunk from the last iteration
	// by pointers.  If we use "i, c := range chks" the variable c is a new
	// variable who's address doesn't change through the entire loop.
	// The current element of the chks slice is copied into it. We must take
	// the address of the indexed slice instead.
	for i := range chks {
		for _, ignoreChkFn := range ignoreChkFns {
			ignore, err := ignoreChkFn(mint, maxt, last, &chks[i])
			if err != nil {
				return nil, errors.Wrap(err, "ignore function")
			}

			if ignore {
				continue OUTER
			}
		}

		last = &chks[i]
		repl = append(repl, chks[i])
	}

	return repl, nil
}

type seriesRepair struct {
	lset labels.Labels
	chks []chunks.Meta
}

View on GitHub (pinned to 35b8b99117)