thanos-io/thanos · error
create meta fetcher
Error message
create meta fetcher
What it means
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.
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.
Example fix
// before (missing credentials in config) thanos downsample --objstore.bucket=metrics --data-dir=/var/thanos // after: supply a valid bucket config thanos downsample --objstore.config-file=/etc/thanos/bucket.yaml --data-dir=/var/thanos
Defensive patterns
Strategy: try-catch
Validate before calling
// Go: verify bucket access before running downsample
if err := bkt.Iter(ctx, "", func(string) error { return nil }); err != nil {
return fmt.Errorf("bucket %s not accessible: %w", bucketName, err)
} Try / catch
// Go: inspect wrapped cause (pkg/errors)
if err := RunDownsample(...); err != nil {
log.Printf("downsample failed: %+v", err) // %+v prints the full wrap chain
} Prevention
- 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.
When it happens
Trigger: thanos downsample invoked with an --objstore.bucket whose bucket client failed initialization, or an internal error constructing the metadata filters (DeduplicateFilter / GatherNoDownsampleMarkFilter).
Common situations: 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.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- sync before first pass of downsampling
- downsampling failed
- sync before second pass of downsampling
- meta.json unmarshal
- unexpected meta file
AI-assisted analysis of thanos-io/thanos@35b8b99117 (2026-09-07).
Data as JSON: /api/errors/fcb5093f532442f9.
Report an issue: GitHub.
Appendix: source
Thrown at cmd/thanos/downsample.go:102
confContentYaml, err := objStoreConfig.Content()
if err != nil {
return err
}
bkt, err := client.NewBucket(logger, confContentYaml, component.Downsample.String(), nil)
if err != nil {
return err
}
insBkt := objstoretracing.WrapWithTraces(objstore.WrapWithMetrics(bkt, extprom.WrapRegistererWithPrefix("thanos_", reg), bkt.Name()))
// While fetching blocks, filter out blocks that were marked for no downsample.
baseBlockIDsFetcher := block.NewConcurrentLister(logger, insBkt)
metaFetcher, err := block.NewMetaFetcher(logger, block.FetcherConcurrency, insBkt, baseBlockIDsFetcher, "", extprom.WrapRegistererWithPrefix("thanos_", reg), []block.MetadataFilter{
block.NewDeduplicateFilter(block.FetcherConcurrency),
downsample.NewGatherNoDownsampleMarkFilter(logger, insBkt, block.FetcherConcurrency),
})
if err != nil {
return errors.Wrap(err, "create meta fetcher")
}
// Ensure we close up everything properly.
defer func() {
if err != nil {
runutil.CloseWithLogOnErr(logger, insBkt, "bucket client")
}
}()
httpProbe := prober.NewHTTP()
statusProber := prober.Combine(
httpProbe,
prober.NewInstrumentation(comp, logger, extprom.WrapRegistererWithPrefix("thanos_", reg)),
)
metrics := newDownsampleMetrics(reg)
// Start cycle of syncing blocks from the bucket and garbage collecting the bucket.
{View on GitHub (pinned to 35b8b99117)