thanos-io/thanos · error

meta.json file exists

Error message

meta.json file exists: %v

What it means

In the meta fetcher's partial-upload detection, a candidate meta.json read exceeded the allowed size and is flagged: 'meta.json file exists: %v'. Fires when a block has an oversized or unexpected meta.json, marking it partial/invalid.

Solutions

  1. Inspect the block's meta.json in the bucket
  2. Let partial-block cleanup remove the malformed block
  3. Check for interrupted uploads
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at pkg/block/fetcher.go:285 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of thanos-io/thanos@35b8b99117 (2026-09-07). Data as JSON: /api/errors/a91d630167bf4550. Report an issue: GitHub.

Appendix: source

Thrown at pkg/block/fetcher.go:285

	const concurrency = 64

	partialBlocks = make(map[ulid.ULID]bool)

	var (
		metaChan = make(chan ulid.ULID, concurrency)
		eg, gCtx = errgroup.WithContext(ctx)
		mu       sync.Mutex
	)
	for range concurrency {
		eg.Go(func() error {
			for uid := range metaChan {
				// TODO(bwplotka): If that causes problems (obj store rate limits), add longer ttl to cached items.
				// For 1y and 100 block sources this generates ~1.5-3k HEAD RPM. AWS handles 330k RPM per prefix.
				// TODO(bwplotka): Consider filtering by consistency delay here (can't do until compactor healthyOverride work).
				metaFile := path.Join(uid.String(), MetaFilename)
				ok, err := f.bkt.Exists(gCtx, metaFile)
				if err != nil {
					return errors.Wrapf(err, "meta.json file exists: %v", uid)
				}
				if !ok {
					mu.Lock()
					partialBlocks[uid] = true
					mu.Unlock()
					continue
				}

				select {
				case <-gCtx.Done():
					return gCtx.Err()
				case activeBlocks <- ActiveBlockFetchData{
					ULID:         uid,
					lastModified: time.Time{}, // Not used, cache busting is only implemented by the recursive lister because otherwise we would have to call Attributes() (one extra call).
				}:
				}
			}
			return nil

View on GitHub (pinned to 35b8b99117)