thanos-io/thanos · error

column not found

Error message

column %s not found

What it means

A lookup guard in the bucket bucket-inspect/verify table writer: a column name passed via the sort-by option is not present in the table header produced for block metadata. The sort key must name one of the known columns (ULID, until-down, series, samples, etc.); the offending column name is the input at fault.

Solutions

  1. Use exact column names shown in the table header
  2. Check --sort-by for typos
  3. Remove the unknown column from --sort-by
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at cmd/thanos/tools_bucket.go:1012 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/4bd8f1f4cfa8614a. Report an issue: GitHub.

Appendix: source

Thrown at cmd/thanos/tools_bucket.go:1012

			timeRange.String(),
			untilDown,
			p.Sprintf("%d", blockMeta.Stats.NumSeries),
			p.Sprintf("%d", blockMeta.Stats.NumSamples),
			p.Sprintf("%d", blockMeta.Stats.NumChunks),
			p.Sprintf("%d", blockMeta.Compaction.Level),
			p.Sprintf("%t", blockMeta.Compaction.Failed),
			strings.Join(labels, ","),
			time.Duration(blockMeta.Thanos.Downsample.Resolution*int64(time.Millisecond)).String(),
			string(blockMeta.Thanos.Source))

		lines = append(lines, line)
	}

	var sortByColNum []int
	for _, col := range sortBy {
		index := getIndex(header, col)
		if index == -1 {
			return errors.Errorf("column %s not found", col)
		}
		sortByColNum = append(sortByColNum, index)
	}

	t := Table{Header: header, Lines: lines, SortIndices: sortByColNum}
	sort.Sort(t)
	err := printer(os.Stdout, t)
	if err != nil {
		return errors.Errorf("unable to write output.")
	}
	return nil
}

func getKeysAlphabetically(labels map[string]string) []string {
	var keys []string
	for k := range labels {
		keys = append(keys, k)
	}

View on GitHub (pinned to 35b8b99117)