{"record":{"id":"401cc4fa361864dc","repo":"thanos-io/thanos","slug":"create-object-storage-store","errorCode":null,"errorMessage":"create object storage store","messagePattern":"create object storage store","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/thanos/store.go","lineNumber":482,"sourceCode":"\t}\n\n\tbs, err := store.NewBucketStore(\n\t\tinsBkt,\n\t\tmetaFetcher,\n\t\tdataDir,\n\t\tstore.NewChunksLimiterFactory(conf.storeRateLimits.SamplesPerRequest/store.MaxSamplesPerChunk), // The samples limit is an approximation based on the max number of samples per chunk.\n\t\tstore.NewSeriesLimiterFactory(conf.storeRateLimits.SeriesPerRequest),\n\t\tstore.NewBytesLimiterFactory(conf.maxDownloadedBytes),\n\t\tstore.NewGapBasedPartitioner(store.PartitionerMaxGapSize),\n\t\tconf.blockSyncConcurrency,\n\t\tconf.postingOffsetsInMemSampling,\n\t\tfalse,\n\t\tconf.lazyIndexReaderEnabled,\n\t\tconf.lazyIndexReaderIdleTimeout,\n\t\toptions...,\n\t)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"create object storage store\")\n\t}\n\n\t// bucketStoreReady signals when bucket store is ready.\n\tbucketStoreReady := make(chan struct{})\n\t{\n\t\tctx, cancel := context.WithCancel(context.Background())\n\t\tg.Add(func() error {\n\t\t\tdefer runutil.CloseWithLogOnErr(logger, insBkt, \"bucket client\")\n\n\t\t\tlevel.Info(logger).Log(\"msg\", \"initializing bucket store\")\n\t\t\tbegin := time.Now()\n\n\t\t\t// This will stop retrying after set timeout duration.\n\t\t\tinitialSyncCtx, cancel := context.WithTimeout(ctx, retryTimeoutDuration*time.Second)\n\t\t\tdefer cancel()\n\n\t\t\t// Retry in case of error.\n\t\t\terr := runutil.Retry(retryIntervalDuration*time.Second, initialSyncCtx.Done(), func() error {","sourceCodeStart":464,"sourceCodeEnd":500,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/store.go#L464-L500","documentation":"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.","triggerScenarios":"Thrown at cmd/thanos/store.go:482 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Review store gateway flags for invalid values","Check data dir usability and options struct","Verify rate limit configurations are positive"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"35b8b991177def87ed52dcf10f9b6d87f07282c8","analyzedAt":"2026-09-07T01:49:59.689Z","contentChangedAt":"2026-09-07T01:49:59.689Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}