{"record":{"id":"0d567c4d508b2356","repo":"thanos-io/thanos","slug":"get-postings-offset-entry","errorCode":null,"errorMessage":"get postings offset entry","messagePattern":"get postings offset entry","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/block/indexheader/binary_reader.go","lineNumber":977,"sourceCode":"\t\t\t// Let's exit and do binary search again / exit if nothing wanted.\n\n\t\t\tif len(newSameRngs) > 0 {\n\t\t\t\t// We added some ranges in this iteration. Use next posting offset as the end of our ranges.\n\t\t\t\t// We know it exists as we never go further in this loop than e.offsets[i, i+1).\n\n\t\t\t\tskipNAndName(&d, &buf)\n\t\t\t\td.UvarintBytes() // Label value.\n\t\t\t\tpostingOffset := int64(d.Uvarint64())\n\n\t\t\t\tfor j := range newSameRngs {\n\t\t\t\t\tnewSameRngs[j].End = postingOffset - crc32.Size\n\t\t\t\t}\n\t\t\t\trngs = append(rngs, newSameRngs...)\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tif d.Err() != nil {\n\t\t\treturn nil, errors.Wrap(d.Err(), \"get postings offset entry\")\n\t\t}\n\t}\n\n\treturn rngs, nil\n}\n\nfunc (r *BinaryReader) LookupSymbol(ctx context.Context, o uint32) (string, error) {\n\tif r.indexVersion == index.FormatV1 {\n\t\t// For v1 little trick is needed. Refs are actual offset inside index, not index-header. This is different\n\t\t// of the header length difference between two files.\n\t\to += headerLen - index.HeaderLen\n\t}\n\n\tif s, ok := r.nameSymbols[o]; ok {\n\t\treturn s, nil\n\t}\n\n\tcacheIndex := o % valueSymbolsCacheSize","sourceCodeStart":959,"sourceCodeEnd":995,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/block/indexheader/binary_reader.go#L959-L995","documentation":"Wrapped decoder error from PostingsOffset: while iterating the postings offset table via index.Decoder to find ranges for a name/value pair, the decoder reported d.Err() (malformed uvarint data or unexpected EOF).","triggerScenarios":"Calling Reader.PostingsOffset(name, value) when the sampled postings table bytes are corrupt/truncated so the decode loop hits a decoding error before finding or exhausting entries.","commonSituations":"Corrupt index files in storage; index-header built from an index that later changed; bit rot or partial transfer of block data.","solutions":["Rebuild the index-header file (delete from bucket, let Thanos regenerate)","Verify the block index integrity and re-upload/re-compact if corrupted","Restore the block from a backup if storage corruption is confirmed"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"rngs, err := br.PostingsOffset(name, value); if err != nil && strings.Contains(err.Error(), \"get postings offset entry\") { fall back to full index postings reader or rebuild header }","preventionTips":["Rebuild index-header files on integrity doubts","Verify block checksums before serving queries","Alert on repeated decode errors from the same block"],"tags":["tsdb","postings","decode","corruption"],"backgroundTag":"file-read-failed","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"}