thanos-io/thanos · error

max concurrency value cannot be lower than 0

Error message

max concurrency value cannot be lower than 0 (got %v)

What it means

A validation guard rejecting a negative --store.max-concurrency value before the query gate is created. Concurrency of 0 means unlimited, so a negative number is meaningless and indicates a misconfigured flag; the store refuses to start.

Solutions

  1. Set the max concurrency flag to 0 or a positive number
  2. Check startup scripts for negative values
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at cmd/thanos/store.go:413 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/1de9b3edcc2c51f5. Report an issue: GitHub.

Appendix: source

Thrown at cmd/thanos/store.go:413

	if err != nil {
		return errors.Wrap(err, "create parquet converted blocks filter")
	}
	metaFetcher, err := block.NewMetaFetcher(logger, conf.blockMetaFetchConcurrency, insBkt, blockLister, dataDir, extprom.WrapRegistererWithPrefix("thanos_", reg),
		[]block.MetadataFilter{
			parquetConvertedBlocksFilter,
			block.NewTimePartitionMetaFilter(conf.filterConf.MinTime, conf.filterConf.MaxTime),
			block.NewLabelShardedMetaFilter(relabelConfig),
			block.NewConsistencyDelayMetaFilter(logger, time.Duration(conf.consistencyDelay), extprom.WrapRegistererWithPrefix("thanos_", reg)),
			ignoreDeletionMarkFilter,
			block.NewDeduplicateFilter(conf.blockMetaFetchConcurrency),
		})
	if err != nil {
		return errors.Wrap(err, "meta fetcher")
	}

	// Limit the concurrency on queries against the Thanos store.
	if conf.maxConcurrency < 0 {
		return errors.Errorf("max concurrency value cannot be lower than 0 (got %v)", conf.maxConcurrency)
	}

	queriesGate := gate.New(extprom.WrapRegistererWithPrefix("thanos_bucket_store_series_", reg), int(conf.maxConcurrency), gate.Queries)

	chunkPool, err := store.NewDefaultChunkBytesPool(uint64(conf.chunkPoolSize))
	if err != nil {
		return errors.Wrap(err, "create chunk pool")
	}

	options := []store.BucketStoreOption{
		store.WithLogger(logger),
		store.WithRequestLoggerFunc(func(ctx context.Context, logger log.Logger) log.Logger {
			reqID, ok := middleware.RequestIDFromContext(ctx)
			if ok {
				return log.With(logger, "request-id", reqID)
			}
			return logger
		}),

View on GitHub (pinned to 35b8b99117)