thanos-io/thanos · error

read parquet metadata file

Error message

read parquet metadata file: %v

What it means

Wraps io.ReadAll on the reader returned by bkt.Get for the parquet conversion metadata file: the object was opened but its contents could not be read to completion (connection reset, truncated object). The migrated-block list cannot be reconstructed.

Solutions

  1. Retry; the object may have been mid-upload
  2. Check parquet bucket consistency
  3. Inspect the object at the given path
Defensive patterns

Strategy: retry

Try / catch

if err := readAll(ctx, path); err != nil {
    if errors.Is(err, context.DeadlineExceeded) { /* raise timeout and retry */ }
    return retry.WithBackoff(ctx, readAll, 3)
}

Prevention

When it happens

Trigger: io.ReadAll(r) fails inside readMigratedBlocksFromParquetMetadata — usually network interruption, context cancellation/deadline during read, or a closed/broken object stream.

Common situations: Large metadata files on slow links hitting request deadlines; bucket connections dropped by proxies/load balancers; ctx canceled due to shutdown or timeout.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


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

Appendix: source

Thrown at pkg/block/fetcher.go:1237

		}
		if canDelete {
			result[b.id] = struct{}{}
		}
	}
	return result
}

func (f *IgnoreParquetConvertedBlocksFilter) readMigratedBlocksFromParquetMetadata(ctx context.Context, path string) (map[ulid.ULID]struct{}, error) {
	migratedBlocks := make(map[ulid.ULID]struct{})
	r, err := f.bkt.Get(ctx, path)
	if err != nil {
		return nil, errors.Wrapf(err, "get parquet metadata file: %v", path)
	}
	defer runutil.CloseWithLogOnErr(f.logger, r, "close bkt get")

	content, err := io.ReadAll(r)
	if err != nil {
		return nil, errors.Wrapf(err, "read parquet metadata file: %v", path)
	}

	var fc easyproto.FieldContext
	for len(content) > 0 {
		content, err = fc.NextField(content)
		if err != nil {
			return nil, errors.Wrapf(err, "read next field from parquet metadata file: %v", path)
		}
		switch fc.FieldNum {
		case 6:
			u, ok := fc.String()
			if !ok {
				return nil, errors.Wrapf(err, "read convertedFromBLIDs field from parquet metadata file: %v", path)
			}
			id, err := ulid.Parse(u)
			if err != nil {
				return nil, errors.Wrapf(err, "parse block ID %q from parquet metadata file: %v", u, path)
			}

View on GitHub (pinned to 35b8b99117)