thanos-io/thanos · error

symbols

Error message

symbols

What it means

After iterating symbols, the library checks symbols.Err() and wraps any iteration error with "symbols". This means the symbol iterator itself failed mid-enumeration (not AddSymbol) — the underlying postings/symbol lookup returned an error while advancing.

Solutions

  1. Check the source block's index integrity; re-download or repair a corrupt symbol table.
  2. Ensure no external process deletes source blocks during compaction.
  3. Retry the compaction after transient IO failures; re-open block readers to reset cached errors.
  4. If reproducible, restore the block from backup/object-store replication before compacting.
Defensive patterns

Strategy: try-catch

Validate before calling

if err := idx.ReadSymbols(ctx, symbolTableSize); err != nil {
    return fmt.Errorf("symbol table unreadable: %w", err)
}

Try / catch

if err := WriteSeries(ctx, populatedSet, symbols); err != nil {
    if isIndexIOError(errors.Cause(err)) {
        // re-sync block and retry once
        if rerr := resyncBlock(ctx, srcID); rerr == nil {
            return WriteSeries(ctx, populatedSet, symbols)
        }
    }
    return err
}

Prevention

When it happens

Trigger: write() completes the AddSymbol loop, then symbols.Err() is non-nil because the symbol set's iterator hit an index-read error (corrupt symbol table, IO failure reading the source index).

Common situations: Corrupt source block symbol table, block index removed mid-compaction, network/IO errors reading index from object-storage-backed readers.

Understand the failure class

Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.

Related errors


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

Appendix: source

Thrown at pkg/compactv2/chunk_series_set.go:188

	if l.populated == nil {
		l.populate()
	}
	l.populated.Compact()
}

func (w *Compactor) write(ctx context.Context, symbols index.StringIter, populatedSet storage.ChunkSeriesSet, sWriter block.SeriesWriter, p ProgressLogger) error {
	var (
		chks []chunks.Meta
		ref  storage.SeriesRef
	)

	for symbols.Next() {
		if err := sWriter.AddSymbol(symbols.At()); err != nil {
			return errors.Wrap(err, "add symbol")
		}
	}
	if err := symbols.Err(); err != nil {
		return errors.Wrap(err, "symbols")
	}

	// Iterate over all sorted chunk series.
	for populatedSet.Next() {
		select {
		case <-ctx.Done():
			return ctx.Err()
		default:
		}

		s := populatedSet.At()
		chksIter := s.Iterator(nil)
		chks = chks[:0]
		for chksIter.Next() {
			// We are not iterating in streaming way over chunk as it's more efficient to do bulk write for index and
			// chunk file purposes.
			chks = append(chks, chksIter.At())
		}

View on GitHub (pinned to 35b8b99117)