{"record":{"id":"fcb5093f532442f9","repo":"thanos-io/thanos","slug":"create-meta-fetcher-fcb509","errorCode":null,"errorMessage":"create meta fetcher","messagePattern":"create meta fetcher","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/thanos/downsample.go","lineNumber":102,"sourceCode":"\tconfContentYaml, err := objStoreConfig.Content()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tbkt, err := client.NewBucket(logger, confContentYaml, component.Downsample.String(), nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\tinsBkt := objstoretracing.WrapWithTraces(objstore.WrapWithMetrics(bkt, extprom.WrapRegistererWithPrefix(\"thanos_\", reg), bkt.Name()))\n\n\t// While fetching blocks, filter out blocks that were marked for no downsample.\n\tbaseBlockIDsFetcher := block.NewConcurrentLister(logger, insBkt)\n\tmetaFetcher, err := block.NewMetaFetcher(logger, block.FetcherConcurrency, insBkt, baseBlockIDsFetcher, \"\", extprom.WrapRegistererWithPrefix(\"thanos_\", reg), []block.MetadataFilter{\n\t\tblock.NewDeduplicateFilter(block.FetcherConcurrency),\n\t\tdownsample.NewGatherNoDownsampleMarkFilter(logger, insBkt, block.FetcherConcurrency),\n\t})\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"create meta fetcher\")\n\t}\n\n\t// Ensure we close up everything properly.\n\tdefer func() {\n\t\tif err != nil {\n\t\t\trunutil.CloseWithLogOnErr(logger, insBkt, \"bucket client\")\n\t\t}\n\t}()\n\n\thttpProbe := prober.NewHTTP()\n\tstatusProber := prober.Combine(\n\t\thttpProbe,\n\t\tprober.NewInstrumentation(comp, logger, extprom.WrapRegistererWithPrefix(\"thanos_\", reg)),\n\t)\n\n\tmetrics := newDownsampleMetrics(reg)\n\t// Start cycle of syncing blocks from the bucket and garbage collecting the bucket.\n\t{","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/downsample.go#L84-L120","documentation":"RunDownsample builds a block.NewMetaFetcher over the object-store bucket to list and fetch block metadata before downsampling. If fetcher construction fails (bad bucket client, conflicting filter setup, etc.), the error is wrapped as \"create meta fetcher\" and the command exits. It indicates the downsampling pipeline could not even start reading metadata.","triggerScenarios":"thanos downsample invoked with an --objstore.bucket whose bucket client failed initialization, or an internal error constructing the metadata filters (DeduplicateFilter / GatherNoDownsampleMarkFilter).","commonSituations":"Wrong or missing bucket credentials; the insBkt client was built against a nonexistent bucket; object storage endpoint unreachable during fetcher setup-dependent steps; regression in custom metadata filters.","solutions":["Check the wrapped root cause in the error chain (bucket client errors are usually the source).","Verify bucket credentials/endpoint: thanos tools bucket verify or a simple list operation on the bucket.","Confirm the bucket name flag (--objstore.bucket / bucket config file) points to an existing bucket."],"exampleFix":"// before (missing credentials in config)\nthanos downsample --objstore.bucket=metrics --data-dir=/var/thanos\n// after: supply a valid bucket config\nthanos downsample --objstore.config-file=/etc/thanos/bucket.yaml --data-dir=/var/thanos","handlingStrategy":"try-catch","validationCode":"// Go: verify bucket access before running downsample\nif err := bkt.Iter(ctx, \"\", func(string) error { return nil }); err != nil {\n    return fmt.Errorf(\"bucket %s not accessible: %w\", bucketName, err)\n}","typeGuard":null,"tryCatchPattern":"// Go: inspect wrapped cause (pkg/errors)\nif err := RunDownsample(...); err != nil {\n    log.Printf(\"downsample failed: %+v\", err) // %+v prints the full wrap chain\n}","preventionTips":["Validate bucket credentials/config with `thanos tools bucket verify` first.","Confirm the bucket name and endpoint in flags or the objstore config file.","Grant the service account list/get permissions on the bucket."],"tags":["object-storage","downsample","blocks"],"backgroundTag":"resource-not-found","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"}