{"record":{"id":"c717a1971399a77c","repo":"thanos-io/thanos","slug":"series-d-not-found","errorCode":null,"errorMessage":"series %d not found","messagePattern":"series (.+?) not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/store/bucket.go","lineNumber":3504,"sourceCode":"\t\tparts = append(parts, p)\n\t}\n\treturn parts\n}\n\ntype symbolizedLabel struct {\n\tname, value uint32\n}\n\n// LoadSeriesForTime populates the given symbolized labels for the series identified by the reference if at least one chunk is within\n// time selection.\n// LoadSeriesForTime also populates chunk metas slices if skipChunks if set to false. Chunks are also limited by the given time selection.\n// LoadSeriesForTime returns false, when there are no series data for given time range.\n//\n// Error is returned on decoding error or if the reference does not resolve to a known series.\nfunc (r *bucketIndexReader) LoadSeriesForTime(ref storage.SeriesRef, lset *[]symbolizedLabel, chks *[]chunks.Meta, skipChunks bool, mint, maxt int64) (ok bool, err error) {\n\tb, ok := r.loadedSeries[ref]\n\tif !ok {\n\t\treturn false, errors.Errorf(\"series %d not found\", ref)\n\t}\n\n\tr.stats.add(SeriesTouched, 1, len(b))\n\treturn decodeSeriesForTime(b, lset, chks, skipChunks, mint, maxt)\n}\n\n// Close released the underlying resources of the reader.\nfunc (r *bucketIndexReader) Close() error {\n\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","sourceCodeStart":3486,"sourceCodeEnd":3522,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/store/bucket.go#L3486-L3522","documentation":"LoadSeriesForTime looks up the raw bytes for a series reference in the reader's already-loaded series map (loadedSeries, populated by Series()). If the ref was never loaded — or was loaded in a different bucketIndexReader instance — the reference cannot be resolved and this error is returned instead of decoding. It is a programming/usage error in the query path rather than a data problem.","triggerScenarios":"Calling LoadSeriesForTime with a storage.SeriesRef that was not previously returned by postings lookup and loaded via Series() on the same reader; using refs from a different block; reader state dropped between calls.","commonSituations":"PromQL/engine fetching samples with stale series refs after a new querier round; refs obtained from postings of block A used against block B; timeouts that discarded loadedSeries before the refetch call.","solutions":["Ensure Series() is called on the same bucketIndexReader for all refs before LoadSeriesForTime","Verify series refs originate from postings of the same block (per-block readers are not interchangeable)","If this comes from a querier component, reload postings and series for the query instead of reusing refs across attempts","Check Thanos version for known bugs where refs outlive their reader lifecycle and upgrade if affected"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"b, ok := r.loadedSeries[ref]\nif !ok {\n\t// ref not loaded by this reader: re-run postings+Series() before LoadSeriesForTime\n}","typeGuard":"func (r *bucketIndexReader) hasSeries(ref storage.SeriesRef) bool { _, ok := r.loadedSeries[ref]; return ok }","tryCatchPattern":"ok, err := reader.LoadSeriesForTime(ref, &lset, &chks, false, mint, maxt)\nif err != nil && strings.Contains(err.Error(), \"not found\") {\n\tif _, lerr := reader.Series(ctx, tenant, []storage.SeriesRef{ref}); lerr == nil {\n\t\tok, err = reader.LoadSeriesForTime(ref, &lset, &chks, false, mint, maxt) // retry after loading\n\t}\n}","preventionTips":["Always call Series() on the same reader before LoadSeriesForTime","Never share series refs across blocks or reader instances","Keep ref lifetime within the reader's scope in the query engine","Cover ref-reuse across query retries with integration tests"],"tags":["thanos","series","refs","query-engine"],"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"}