{"record":{"id":"fddd9d19bf44162a","repo":"thanos-io/thanos","slug":"read-symbols","errorCode":null,"errorMessage":"read symbols","messagePattern":"read symbols","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/block/indexheader/binary_reader.go","lineNumber":693,"sourceCode":"\t}\n\tr.version = int(r.b.Range(4, 5)[0])\n\tr.indexVersion = int(r.b.Range(5, 6)[0])\n\n\tr.indexLastPostingEnd = int64(binary.BigEndian.Uint64(r.b.Range(6, headerLen)))\n\n\tif r.version != BinaryFormatV1 {\n\t\treturn errors.Errorf(\"unknown index header file version %d\", r.version)\n\t}\n\n\tr.toc, err = newBinaryTOCFromByteSlice(r.b)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"read index header TOC\")\n\t}\n\n\t// TODO(bwplotka): Consider contributing to Prometheus to allow specifying custom number for symbolsFactor.\n\tr.symbols, err = index.NewSymbols(r.b, r.indexVersion, int(r.toc.Symbols))\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"read symbols\")\n\t}\n\n\tvar lastName, lastValue []byte\n\tif r.indexVersion == index.FormatV1 {\n\t\t// Earlier V1 formats don't have a sorted postings offset table, so\n\t\t// load the whole offset table into memory.\n\t\tr.postingsV1 = map[string]map[string]index.Range{}\n\n\t\tvar prevRng index.Range\n\t\tif err := index.ReadPostingsOffsetTable(r.b, r.toc.PostingsOffsetTable, func(name, value []byte, postingsOffset uint64, _ int) error {\n\t\t\tif lastName != nil {\n\t\t\t\tprevRng.End = int64(postingsOffset - crc32.Size)\n\t\t\t\tr.postingsV1[string(lastName)][string(lastValue)] = prevRng\n\t\t\t}\n\n\t\t\tif _, ok := r.postingsV1[string(name)]; !ok {\n\t\t\t\tr.postingsV1[string(name)] = map[string]index.Range{}\n\t\t\t\tr.postings[string(name)] = nil // Used to get a list of labelnames in places.","sourceCodeStart":675,"sourceCodeEnd":711,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/block/indexheader/binary_reader.go#L675-L711","documentation":"Thrown when index.NewSymbols fails while loading the symbol table from the index file, using the offset recorded in the index-header TOC. It indicates the symbol table section of the source index is unreadable, or the index version recorded in the index-header does not match the actual index format.","triggerScenarios":"NewBinaryReader parses the index-header successfully but index.NewSymbols(r.b, r.indexVersion, toc.Symbols) fails because the symbol table offset is wrong, the symbol section is corrupt, or indexVersion (FormatV1/V2) is inconsistent with the data.","commonSituations":"Blocks uploaded by a different Prometheus/Thanos version than the reader expects; truncated index files; index-header generated from a different index than the one being read (mismatched pair in storage).","solutions":["Regenerate the index-header file (delete it from the bucket so Thanos recreates it from the index)","Verify the index file integrity and that index-header and index belong to the same block","Ensure Prometheus/Thanos versions are consistent with the block format versions","Re-upload the affected block from a healthy source"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if st, err := os.Stat(indexPath); err != nil || st.Size() == 0 { /* restore/re-upload block before building index-header */ }","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"read symbols\") { regenerate index-header; if persists, quarantine block }","preventionTips":["Keep index-header and index files from the same build together","Verify index file checksum after upload/download","Pin Thanos/Prometheus versions compatible with your block formats"],"tags":["tsdb","index-header","symbols","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"}