{"record":{"id":"445703f7e9b3ca7e","repo":"thanos-io/thanos","slug":"basefetcher-iter-bucket","errorCode":null,"errorMessage":"BaseFetcher: iter bucket","messagePattern":"BaseFetcher: iter bucket","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/block/fetcher.go","lineNumber":593,"sourceCode":"\t\t\t\tmtx.Lock()\n\t\t\t\tresp.partial[id] = err\n\t\t\t\tmtx.Unlock()\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\t}\n\n\tvar partialBlocks map[ulid.ULID]bool\n\tvar err error\n\t// Workers scheduled, distribute blocks.\n\teg.Go(func() error {\n\t\tdefer close(activeBlocksCh)\n\t\tpartialBlocks, err = f.blockIDsLister.GetActiveAndPartialBlockIDs(ctx, activeBlocksCh)\n\t\treturn err\n\t})\n\n\tif err := eg.Wait(); err != nil {\n\t\treturn nil, errors.Wrap(err, \"BaseFetcher: iter bucket\")\n\t}\n\n\tmtx.Lock()\n\tfor blockULID, isPartial := range partialBlocks {\n\t\tif isPartial {\n\t\t\tresp.partial[blockULID] = errors.Errorf(\"block %s has no meta file\", blockULID)\n\t\t\tresp.noMetas++\n\t\t}\n\t}\n\tmtx.Unlock()\n\n\tif len(resp.metaErrs) > 0 {\n\t\treturn resp, nil\n\t}\n\n\t// Only for complete view of blocks update the cache.\n\n\tcached := &sync.Map{}","sourceCodeStart":575,"sourceCodeEnd":611,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/block/fetcher.go#L575-L611","documentation":"fetchMetadata runs errgroup goroutines that iterate the bucket via blockIDsLister.GetActiveAndPartialBlockIDs. If that listing fails (any object-store error during List), eg.Wait() returns it and fetchMetadata wraps it with \"BaseFetcher: iter bucket\". It is a fatal sync error: the block list itself could not be obtained, so no metadata fetch proceeds.","triggerScenarios":"Calling fetchMetadata/FetchMetadata (sync) when the underlying object store List/Iter call fails — expired credentials, network failure, bucket missing, or bucket lister misconfiguration.","commonSituations":"Wrong bucket name or region in store config; IAM credentials lacking s3:ListBucket (or equivalent) permission; S3/GCS outage or VPC without egress; typos in endpoint configuration.","solutions":["Read the wrapped inner error to see the object-store cause; verify credentials and List permission on the bucket (e.g. s3:ListBucket).","Verify bucket name, region/endpoint in the bucket client configuration.","Test bucket connectivity with the provider CLI (aws s3 ls / gsutil ls) from the same host/network.","Retry on transient network errors; check provider status page for outages."],"exampleFix":"// before: bucket config with wrong region/missing permission\n// s3: endpoint=s3.amazonaws.com, bucket=my-blocks (us-east-1 bucket, client in eu-west-1)\n// after: fix region and grant list permission\n// s3: endpoint=s3.eu-west-1.amazonaws.com, bucket=my-blocks, IAM policy allows s3:ListBucket","handlingStrategy":"retry","validationCode":"// Before sync: verify bucket list access\n_, err := bucket.Iter(ctx, \"\", func(string) error { return nil })\nif err != nil {\n    // fail fast with a clear config/permission message\n}","typeGuard":null,"tryCatchPattern":"metas, err := fetcher.FetchMetadata(ctx, filtered)\nif err != nil && strings.Contains(err.Error(), \"BaseFetcher: iter bucket\") {\n    // transient object-store failure: backoff and retry sync\n    time.Sleep(retryBackoff)\n    metas, err = fetcher.FetchMetadata(ctx, filtered)\n}","preventionTips":["Grant the sync identity List permission on the bucket (s3:ListBucket / storage.objects.list).","Verify bucket name, region and endpoint in the object store config with the provider CLI first.","Configure retry/backoff options in the bucket client (e.g. S3 Retryer, HTTP timeouts).","Alert on sync failures instead of silently skipping sync cycles."],"tags":["object-storage","network","sync","permissions"],"backgroundTag":"http-request-failed","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"}