{"record":{"id":"245ee02a41b32d2c","repo":"thanos-io/thanos","slug":"create-meta-fetcher-245ee0","errorCode":null,"errorMessage":"create meta fetcher","messagePattern":"create meta fetcher","errorType":"console","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"cmd/thanos/tools_bucket.go","lineNumber":875,"sourceCode":"\t\tg.Add(func() error { return nil }, func(error) {})\n\n\t\tstubCounter := promauto.With(nil).NewCounter(prometheus.CounterOpts{})\n\n\t\t// While fetching blocks, we filter out blocks that were marked for deletion by using IgnoreDeletionMarkFilter.\n\t\t// The delay of deleteDelay/2 is added to ensure we fetch blocks that are meant to be deleted but do not have a replacement yet.\n\t\t// This is to make sure compactor will not accidentally perform compactions with gap instead.\n\t\tignoreDeletionMarkFilter := block.NewIgnoreDeletionMarkFilter(logger, insBkt, tbc.deleteDelay/2, tbc.blockSyncConcurrency)\n\t\tduplicateBlocksFilter := block.NewDeduplicateFilter(tbc.blockSyncConcurrency)\n\t\tblocksCleaner := compact.NewBlocksCleaner(logger, insBkt, ignoreDeletionMarkFilter, tbc.deleteDelay, stubCounter, stubCounter)\n\n\t\tctx := context.Background()\n\n\t\tvar sy *compact.Syncer\n\t\t{\n\t\t\tbaseBlockIDsFetcher := block.NewConcurrentLister(logger, insBkt)\n\t\t\tbaseMetaFetcher, err := block.NewBaseFetcher(logger, tbc.blockSyncConcurrency, insBkt, baseBlockIDsFetcher, \"\", extprom.WrapRegistererWithPrefix(extpromPrefix, reg))\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrap(err, \"create meta fetcher\")\n\t\t\t}\n\t\t\tcf := baseMetaFetcher.NewMetaFetcher(\n\t\t\t\textprom.WrapRegistererWithPrefix(extpromPrefix, reg), []block.MetadataFilter{\n\t\t\t\t\tblock.NewLabelShardedMetaFilter(relabelConfig),\n\t\t\t\t\tblock.NewConsistencyDelayMetaFilter(logger, tbc.consistencyDelay, extprom.WrapRegistererWithPrefix(extpromPrefix, reg)),\n\t\t\t\t\tignoreDeletionMarkFilter,\n\t\t\t\t\tduplicateBlocksFilter,\n\t\t\t\t},\n\t\t\t)\n\t\t\tsy, err = compact.NewMetaSyncer(\n\t\t\t\tlogger,\n\t\t\t\treg,\n\t\t\t\tinsBkt,\n\t\t\t\tcf,\n\t\t\t\tduplicateBlocksFilter,\n\t\t\t\tignoreDeletionMarkFilter,\n\t\t\t\tstubCounter,\n\t\t\t\tstubCounter,","sourceCodeStart":857,"sourceCodeEnd":893,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/tools_bucket.go#L857-L893","documentation":"During compact/replicate setup, block.NewBaseFetcher creates the fetcher that lists bucket objects and downloads block metadata. This error wraps its initialization failure — typically a problem listing or reading meta.json files from the object store, or invalid fetcher options. It occurs before any syncing starts.","triggerScenarios":"Running a compact/replicate command where NewBaseFetcher fails at cmd/thanos/tools_bucket.go:875 — usually the initial ListObjects call fails (bad bucket client config, missing permissions) or the fetcher's concurrency/registry options are invalid.","commonSituations":"Bucket credentials lacking s3:ListBucket permission, wrong bucket name/endpoint in the objstore config, network/proxy blocking the storage API, or a Thanos version mismatch making the fetcher reject the bucket layout.","solutions":["Read the wrapped inner error — it usually names the exact object-store call that failed.","Verify the bucket is reachable and credentials allow listing: `thanos tools bucket ls <bucket>`.","Check IAM permissions: ListObjects/Get must be allowed for the configured prefix.","Validate --objstore.config-file (endpoint, region, bucket name) for typos.","Check network/proxy/DNS connectivity from the host to the storage endpoint."],"exampleFix":"// before: bucket name typo in config\nconfContentYaml = []byte(\"type: S3\\nbucket: thano-blocks\")\n// after\nconfContentYaml = []byte(\"type: S3\\nbucket: thanos-blocks\\nendpoint: s3.amazonaws.com\\nregion: us-east-1\")","handlingStrategy":"retry","validationCode":"// Pre-flight: confirm the bucket is listable with the same config\nls := client.NewBucket(...) // or simply run:\n// thanos tools bucket ls --objstore.config-file=b.yml | head -1","typeGuard":null,"tryCatchPattern":"baseMetaFetcher, err := block.NewBaseFetcher(...)\nif err != nil {\n    if isTransientStorageError(errors.Unwrap(err)) {\n        time.Sleep(retryBackoff)\n        baseMetaFetcher, err = block.NewBaseFetcher(...) // retry\n    }\n}","preventionTips":["Smoke-test listing with `thanos tools bucket ls` before compaction","Grant List/Get IAM permissions for the bucket and prefix","Verify endpoint/region/bucket name in the objstore config","Monitor network/proxy paths to the storage API from the host"],"tags":["object-storage","block-metadata","initialization"],"backgroundTag":"api-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"}