thanos-io/thanos · error

invalid concurrency level

Error message

invalid concurrency level (%d), concurrency level must be > 0

What it means

A parameter-validation guard at the top of NewBucketCompactor: the caller-supplied `concurrency` argument (the number of parallel compaction workers used to run compaction groups) was zero or negative, so the constructor refuses to build a BucketCompactor because there would be no workers to execute the compaction plan. The offending input is the `concurrency int` parameter itself, not any on-disk block state.

Solutions

  1. Set compaction concurrency to at least 1
  2. Fix startup configuration passing 0 or negative values
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pkg/compact/compact.go:1432 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/f71da0f9226b4510. Report an issue: GitHub.

Appendix: source

Thrown at pkg/compact/compact.go:1432

	skipBlocksWithOutOfOrderChunks bool
	blocksCleaner                  *BlocksCleaner
}

// NewBucketCompactor creates a new bucket compactor.
func NewBucketCompactor(
	logger log.Logger,
	sy *Syncer,
	grouper Grouper,
	planner Planner,
	comp Compactor,
	compactDir string,
	bkt objstore.Bucket,
	concurrency int,
	skipBlocksWithOutOfOrderChunks bool,
	blocksCleaner *BlocksCleaner,
) (*BucketCompactor, error) {
	if concurrency <= 0 {
		return nil, errors.Errorf("invalid concurrency level (%d), concurrency level must be > 0", concurrency)
	}
	return NewBucketCompactorWithCheckerAndCallback(
		logger,
		sy,
		grouper,
		planner,
		comp,
		DefaultBlockDeletableChecker{},
		DefaultCompactionLifecycleCallback{},
		compactDir,
		bkt,
		concurrency,
		skipBlocksWithOutOfOrderChunks,
		blocksCleaner,
	)
}

func NewBucketCompactorWithCheckerAndCallback(

View on GitHub (pinned to 35b8b99117)