{"record":{"id":"00985d61a76b6b64","repo":"thanos-io/thanos","slug":"label-names-for-block-s","errorCode":null,"errorMessage":"label names for block %s","messagePattern":"label names for block (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/store/bucket.go","lineNumber":1929,"sourceCode":"\t\tindexr := b.indexReader(blockLogger)\n\n\t\tg.Go(func() error {\n\t\t\tspan, newCtx := tracing.StartSpan(gctx, \"bucket_store_block_label_names\", tracing.Tags{\n\t\t\t\t\"block.id\":         b.meta.ULID,\n\t\t\t\t\"block.mint\":       b.meta.MinTime,\n\t\t\t\t\"block.maxt\":       b.meta.MaxTime,\n\t\t\t\t\"block.resolution\": b.meta.Thanos.Downsample.Resolution,\n\t\t\t})\n\t\t\tdefer span.Finish()\n\t\t\tdefer runutil.CloseWithLogOnErr(blockLogger, indexr, \"label names\")\n\n\t\t\tvar result []string\n\t\t\tif len(reqSeriesMatchersNoExtLabels) == 0 {\n\t\t\t\t// Do it via index reader to have pending reader registered correctly.\n\t\t\t\t// LabelNames are already sorted.\n\t\t\t\tres, err := indexr.block.indexHeaderReader.LabelNames()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn errors.Wrapf(err, \"label names for block %s\", b.meta.ULID)\n\t\t\t\t}\n\n\t\t\t\t// Add  a set for the external labels as well.\n\t\t\t\t// We're not adding them directly to refs because there could be duplicates.\n\t\t\t\t// b.extLset is already sorted by label name, no need to sort it again.\n\t\t\t\textRes := make([]string, 0, b.extLset.Len())\n\t\t\t\tb.extLset.Range(func(l labels.Label) {\n\t\t\t\t\tif _, ok := extLsetToRemove[l.Name]; !ok {\n\t\t\t\t\t\textRes = append(extRes, l.Name)\n\t\t\t\t\t}\n\t\t\t\t})\n\n\t\t\t\tresult = strutil.MergeSlices(int(req.Limit), res, extRes)\n\t\t\t} else {\n\t\t\t\tseriesReq := &storepb.SeriesRequest{\n\t\t\t\t\tMinTime:              req.Start,\n\t\t\t\t\tMaxTime:              req.End,\n\t\t\t\t\tSkipChunks:           true,","sourceCodeStart":1911,"sourceCodeEnd":1947,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/store/bucket.go#L1911-L1947","documentation":"While serving LabelNames, the store gateway opens a per-block index header reader and calls LabelNames() on the block's index. A failure wrapped with the block ULID means reading label names from that block's index failed — typically corrupt/truncated index-header files or a block being removed mid-request.","triggerScenarios":"indexHeaderReader.LabelNames() errors because the .index file or its sidecar index-header is missing/corrupt, checksum fails, or the block was deleted by compaction while the reader was open.","commonSituations":"Interruption while downloading/offloading blocks leaving truncated index files; bucket lifecycle policies deleting blocks under an active store gateway; corrupted object storage uploads; stale index-header after block replacement.","solutions":["Identify the block ULID from the message; verify its index files in the bucket (thanos tools bucket verify).","Delete the local cached index-header so the store gateway re-downloads it, then restart/reload.","Check for blocks pending deletion markers (deletion-mark.json) and sync store gateway metadata.","Re-upload/restore the block from a healthy source if the object is genuinely corrupt."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"if strings.Contains(err.Error(), blkID) {\n    // exclude this block and retry LabelNames without it\n}","preventionTips":["Run 'thanos tools bucket verify' periodically","Avoid deleting/offloading blocks while store gateway serves them (use deletion marks)","Clear stale local index-header cache after bucket changes"],"tags":["thanos-store","index","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"}