thanos-io/thanos · error

create object storage store

Error message

create object storage store

What it means

Wraps store.NewBucketStore, the constructor that assembles the store gateway over the object storage bucket. Any misconfiguration surfaced at construction time — invalid limits, partitioner setup, or lazy index reader options — is returned under this message, aborting the store API startup.

Solutions

  1. Review store gateway flags for invalid values
  2. Check data dir usability and options struct
  3. Verify rate limit configurations are positive
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at cmd/thanos/store.go:482 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/401cc4fa361864dc. Report an issue: GitHub.

Appendix: source

Thrown at cmd/thanos/store.go:482

	}

	bs, err := store.NewBucketStore(
		insBkt,
		metaFetcher,
		dataDir,
		store.NewChunksLimiterFactory(conf.storeRateLimits.SamplesPerRequest/store.MaxSamplesPerChunk), // The samples limit is an approximation based on the max number of samples per chunk.
		store.NewSeriesLimiterFactory(conf.storeRateLimits.SeriesPerRequest),
		store.NewBytesLimiterFactory(conf.maxDownloadedBytes),
		store.NewGapBasedPartitioner(store.PartitionerMaxGapSize),
		conf.blockSyncConcurrency,
		conf.postingOffsetsInMemSampling,
		false,
		conf.lazyIndexReaderEnabled,
		conf.lazyIndexReaderIdleTimeout,
		options...,
	)
	if err != nil {
		return errors.Wrap(err, "create object storage store")
	}

	// bucketStoreReady signals when bucket store is ready.
	bucketStoreReady := make(chan struct{})
	{
		ctx, cancel := context.WithCancel(context.Background())
		g.Add(func() error {
			defer runutil.CloseWithLogOnErr(logger, insBkt, "bucket client")

			level.Info(logger).Log("msg", "initializing bucket store")
			begin := time.Now()

			// This will stop retrying after set timeout duration.
			initialSyncCtx, cancel := context.WithTimeout(ctx, retryTimeoutDuration*time.Second)
			defer cancel()

			// Retry in case of error.
			err := runutil.Retry(retryIntervalDuration*time.Second, initialSyncCtx.Done(), func() error {

View on GitHub (pinned to 35b8b99117)