{"record":{"id":"18b21c4265064e0a","repo":"thanos-io/thanos","slug":"lookup-label-name","errorCode":null,"errorMessage":"lookup label name","messagePattern":"lookup label name","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/store/bucket.go","lineNumber":3531,"sourceCode":"\tr.block.pendingReaders.Done()\n\n\tif r.postings != nil {\n\t\tputPostingsSlice(r.postings)\n\t}\n\treturn nil\n}\n\nfunc (b *blockSeriesClient) CloseSend() error {\n\treturn nil\n}\n\n// LookupLabelsSymbols allows populates label set strings from symbolized label set.\nfunc (r *bucketIndexReader) LookupLabelsSymbols(ctx context.Context, symbolized []symbolizedLabel, b *labels.Builder) error {\n\tb.Reset(labels.EmptyLabels())\n\tfor _, s := range symbolized {\n\t\tln, err := r.dec.LookupSymbol(ctx, s.name)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"lookup label name\")\n\t\t}\n\t\tlv, err := r.dec.LookupSymbol(ctx, s.value)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"lookup label value\")\n\t\t}\n\t\tb.Set(ln, lv)\n\t}\n\treturn nil\n}\n\n// decodeSeriesForTime decodes a series entry from the given byte slice decoding only chunk metas that are within given min and max time.\n// If skipChunks is specified decodeSeriesForTime does not return any chunks, but only labels and only if at least single chunk is within time range.\n// decodeSeriesForTime returns false, when there are no series data for given time range.\nfunc decodeSeriesForTime(b []byte, lset *[]symbolizedLabel, chks *[]chunks.Meta, skipChunks bool, selectMint, selectMaxt int64) (ok bool, err error) {\n\t*lset = (*lset)[:0]\n\t*chks = (*chks)[:0]\n\n\td := encoding.Decbuf{B: b}","sourceCodeStart":3513,"sourceCodeEnd":3549,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/store/bucket.go#L3513-L3549","documentation":"LookupLabelsSymbols converts symbolized label pairs back to strings by resolving symbol table references via r.dec.LookupSymbol. Wrapping the name lookup means a symbol referenced by a decoded series does not exist in the block's symbol table — the index bytes reference symbols the reader cannot resolve (wrong block/symbols version, corrupt data, or stale cached series bytes).","triggerScenarios":"A symbolizedLabel's name reference fails r.dec.LookupSymbol during label-set materialization: cached series bytes belong to a different/older index, symbols cache missing entries, or corrupted index symbol table.","commonSituations":"Block replaced (ULID reused) causing cached series bytes to reference the wrong symbol table; incomplete index upload missing symbol table sections; querying a block while it is being compacted/deleted.","solutions":["Invalidate the series cache for the affected block so bytes are re-fetched from the same index version","Verify the block's index (thanos tools bucket verify) and remove/re-upload corrupted blocks","Make sure the index header and symbol table come from the same block instance (never rebuild blocks with reused ULIDs)","Retry the query after store-gateway resyncs its block list to pick up the correct block version"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"if !r.dec.HasSymbol(ctx, s.name) || !r.dec.HasSymbol(ctx, s.value) {\n\t// symbol missing from table: re-fetch series bytes from the correct index version\n}","typeGuard":"func symbolsResolvable(dec index.Decoder, s symbolizedLabel) bool { return dec.HasSymbol(s.name) && dec.HasSymbol(s.value) }","tryCatchPattern":"if err := r.LookupLabelsSymbols(ctx, symbolized, b); err != nil {\n\tlogger.Warn(\"symbol lookup failed; refetching series without cache\", \"err\", err)\n\tinvalidateSeriesCache(blockMeta.ULID)\n\treturn retryLookup(ctx, symbolized, b) // retry against fresh index bytes\n}","preventionTips":["Invalidate cached series bytes when a block is replaced","Never rebuild blocks with reused ULIDs","Validate index symbol table completeness after uploads","Monitor symbol-lookup failures per block to catch corruption early"],"tags":["thanos","symbols","labels","index","corruption"],"backgroundTag":"record-not-found","analyzedSha":"35b8b991177def87ed52dcf10f9b6d87f07282c8","analyzedAt":"2026-09-07T01:49:59.689Z","contentChangedAt":"2026-09-07T01:49:59.689Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}