{"record":{"id":"283a2b2829ae1cea","repo":"thanos-io/thanos","slug":"invalid-result-block-s","errorCode":null,"errorMessage":"invalid result block %s","messagePattern":"invalid result block (.+?)","errorType":"exception","errorClass":"halt","httpStatus":null,"severity":"error","filePath":"pkg/compact/compact.go","lineNumber":1324,"sourceCode":"\t\t\treturn false, nil, errors.Wrap(err, \"remove tombstones\")\n\t\t}\n\n\t\tnewMeta, err := metadata.ReadFromDir(bdir)\n\t\tif err != nil {\n\t\t\treturn false, nil, errors.Wrap(err, \"read new meta\")\n\t\t}\n\n\t\tvar stats block.HealthStats\n\t\t// Ensure the output block is valid.\n\t\terr = tracing.DoInSpanWithErr(ctx, \"compaction_verify_index\", func(ctx context.Context) error {\n\t\t\tstats, err = block.GatherIndexHealthStats(ctx, cg.logger, index, newMeta.MinTime, newMeta.MaxTime)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn stats.AnyErr()\n\t\t})\n\t\tif !cg.acceptMalformedIndex && err != nil {\n\t\t\treturn false, nil, halt(errors.Wrapf(err, \"invalid result block %s\", bdir))\n\t\t}\n\n\t\tthanosMeta := metadata.Thanos{\n\t\t\tLabels:       cg.labels.Map(),\n\t\t\tDownsample:   metadata.ThanosDownsample{Resolution: cg.resolution},\n\t\t\tSource:       metadata.CompactorSource,\n\t\t\tSegmentFiles: block.GetSegmentFiles(bdir),\n\t\t\tExtensions:   cg.Extensions(),\n\t\t}\n\t\tif stats.ChunkMaxSize > 0 {\n\t\t\tthanosMeta.IndexStats.ChunkMaxSize = stats.ChunkMaxSize\n\t\t}\n\t\tif stats.SeriesMaxSize > 0 {\n\t\t\tthanosMeta.IndexStats.SeriesMaxSize = stats.SeriesMaxSize\n\t\t}\n\t\tnewMeta, err = metadata.InjectThanos(cg.logger, bdir, thanosMeta, nil)\n\t\tif err != nil {\n\t\t\treturn false, nil, errors.Wrapf(err, \"failed to finalize the block %s\", bdir)","sourceCodeStart":1306,"sourceCodeEnd":1342,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/compact/compact.go#L1306-L1342","documentation":"Wraps (as a halt-worthy error) the failure of block.GatherIndexHealth_stats over the compacted block's index: the index could not be read or contains out-of-bounds/overlapping series outside accepted limits. Since the output of compaction itself is suspect, the whole compactor halts for manual intervention unless accept-malformed-index is enabled.","triggerScenarios":"Thrown at pkg/compact/compact.go:1324 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Investigate index health errors for the block","Re-run compaction from source blocks","Use --accept-malformed-index only deliberately"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}