{"record":{"id":"68ebbc7dc8a40a28","repo":"thanos-io/thanos","slug":"bucket-store-initial-sync","errorCode":null,"errorMessage":"bucket store initial sync","messagePattern":"bucket store initial sync","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/thanos/store.go","lineNumber":506,"sourceCode":"\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 {\n\t\t\t\treturn bs.InitialSync(ctx)\n\t\t\t})\n\n\t\t\tif err != nil {\n\t\t\t\tclose(bucketStoreReady)\n\t\t\t\treturn errors.Wrap(err, \"bucket store initial sync\")\n\t\t\t}\n\n\t\t\tlevel.Info(logger).Log(\"msg\", \"bucket store ready\", \"init_duration\", time.Since(begin).String())\n\t\t\tclose(bucketStoreReady)\n\n\t\t\terr = runutil.Repeat(conf.syncInterval, ctx.Done(), func() error {\n\t\t\t\tif err := bs.SyncBlocks(ctx); err != nil {\n\t\t\t\t\tlevel.Warn(logger).Log(\"msg\", \"syncing blocks failed\", \"err\", err)\n\t\t\t\t}\n\t\t\t\treturn nil\n\t\t\t})\n\n\t\t\trunutil.CloseWithLogOnErr(logger, bs, \"bucket store\")\n\t\t\treturn err\n\t\t}, func(error) {\n\t\t\tcancel()\n\t\t})\n\t}","sourceCodeStart":488,"sourceCodeEnd":524,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/store.go#L488-L524","documentation":"bs.InitialSync failed after all retries within the retry timeout: the store gateway could not list and download block metadata from object storage (network, credentials, or bucket errors). The bucket store stays uninitialized and the run group shuts down.","triggerScenarios":"Thrown at cmd/thanos/store.go:506 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check object storage connectivity and credentials","Verify bucket permissions (list/get)","Look at retried error messages for the root cause","Retry startup once storage is healthy"],"exampleFix":null,"handlingStrategy":"retry","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"}