{"record":{"id":"49e7f74fc26a4f34","repo":"thanos-io/thanos","slug":"reverse-symbol-lookup","errorCode":null,"errorMessage":"reverse symbol lookup","messagePattern":"reverse symbol lookup","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/block/indexheader/binary_reader.go","lineNumber":785,"sourceCode":"\t\t\t// In worst case we will overfetch a few bytes.\n\t\t\tr.postings[string(lastName)].lastValOffset = r.indexLastPostingEnd - crc32.Size\n\t\t}\n\t\t// Trim any extra space in the slices.\n\t\tfor k, v := range r.postings {\n\t\t\tl := make([]postingOffset, len(v.offsets))\n\t\t\tcopy(l, v.offsets)\n\t\t\tr.postings[k].offsets = l\n\t\t}\n\t}\n\n\tr.nameSymbols = make(map[uint32]string, len(r.postings))\n\tfor k := range r.postings {\n\t\tif k == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\toff, err := r.symbols.ReverseLookup(k)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"reverse symbol lookup\")\n\t\t}\n\t\tr.nameSymbols[off] = k\n\t}\n\n\tr.dec = &index.Decoder{LookupSymbol: r.LookupSymbol}\n\n\treturn nil\n}\n\nfunc (r *BinaryReader) IndexVersion() (int, error) {\n\treturn r.indexVersion, nil\n}\n\n// PostingsOffsets implements Reader.\nfunc (r *BinaryReader) PostingsOffsets(name string, values ...string) ([]index.Range, error) {\n\treturn r.postingsOffset(name, values...)\n}\n","sourceCodeStart":767,"sourceCodeEnd":803,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/block/indexheader/binary_reader.go#L767-L803","documentation":"Wrapped error when symbols.ReverseLookup fails for a label name found in the postings table. It means a label name present in the postings offset table is missing from the symbol table — an internal consistency violation of the index file.","triggerScenarios":"During NewBinaryReader, iterating r.postings label names and calling r.symbols.ReverseLookup(k) fails because the name is absent from the symbol table (corrupt or mismatched index sections).","commonSituations":"Index files assembled from mixed/partial uploads; corruption of the symbol section while postings survive; index-header built from a different index than the one in the bucket.","solutions":["Delete the index-header file so Thanos rebuilds it from the (valid) index","Validate the block's index file integrity; re-upload or re-compact the block if corrupt","Confirm index-header and index in the bucket belong to the same block ID","Restore the block from backup/object versioning"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"reverse symbol lookup\") { quarantine/re-upload the block; it is structurally inconsistent }","preventionTips":["Never manually assemble or edit index files","Verify blocks after download (checksums)","Use object versioning to recover corrupt blocks"],"tags":["tsdb","symbols","corruption","invariant"],"backgroundTag":"internal-invariant-violation","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"}