{"record":{"id":"4dfe05ba9446a084","repo":"thanos-io/thanos","slug":"joined-health-check-error-messages-anyerr","errorCode":null,"errorMessage":"joined health-check error messages (AnyErr)","messagePattern":"joined health-check error messages \\(AnyErr\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/block/index.go","lineNumber":175,"sourceCode":"\n\tif err := i.CriticalErr(); err != nil {\n\t\terrMsg = append(errMsg, err.Error())\n\t}\n\n\tif err := i.Issue347OutsideChunksErr(); err != nil {\n\t\terrMsg = append(errMsg, err.Error())\n\t}\n\n\tif err := i.OutOfOrderLabelsErr(); err != nil {\n\t\terrMsg = append(errMsg, err.Error())\n\t}\n\n\tif err := i.OutOfOrderChunksErr(); err != nil {\n\t\terrMsg = append(errMsg, err.Error())\n\t}\n\n\tif len(errMsg) > 0 {\n\t\treturn errors.New(strings.Join(errMsg, \", \"))\n\t}\n\n\treturn nil\n}\n\ntype minMaxSumInt64 struct {\n\tsum int64\n\tmin int64\n\tmax int64\n\n\tcnt int64\n}\n\nfunc newMinMaxSumInt64() minMaxSumInt64 {\n\treturn minMaxSumInt64{\n\t\tmin: math.MaxInt64,\n\t\tmax: math.MinInt64,\n\t}","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/block/index.go#L157-L193","documentation":"AnyErr is the aggregate health verdict for a block index: it joins the messages from CriticalErr, Issue347OutsideChunksErr, OutOfOrderLabelsErr and OutOfOrderChunksErr into a single comma-joined error. The message 'joined health-check error messages (AnyErr)' represents this aggregation; it is non-nil when any known block issue was detected by GatherIndexHealthStats. VerifyIndex uses it as its return value.","triggerScenarios":"Called at the end of block.VerifyIndex (stats.AnyErr()) after GatherIndexHealthStats walked the index; fires whenever any of: outside/critical chunks, issue-347 chunks, out-of-order labels (Prometheus <=2.8.0), or out-of-order chunks were found. Multiple issues appear joined as one message.","commonSituations":"`thanos tools bucket verify` failing on historical blocks; compaction planner marking blocks for repair; store gateway or querier operators investigating bad blocks in object storage; blocks produced by old Prometheus versions.","solutions":["Read the joined message to identify which sub-issue(s) apply (critical outsiders, issue 347, out-of-order labels, out-of-order chunks).","Run block.Repair with the appropriate ignore functions (IgnoreCompleteOutsideChunk, IgnoreIssue347OutsideChunk, IgnoreDuplicateOutsideChunk) to produce a fixed block.","For out-of-order labels (Prometheus <=2.8.0), upgrade Prometheus and regenerate/re-upload the block.","Mark/remove the bad block from the bucket and backfill from source if repair cannot fix it."],"exampleFix":"// before\nif err := stats.AnyErr(); err != nil { return errors.Wrap(err, \"block is corrupted\") }\n// after: branch on sub-issues\nif err := stats.CriticalErr(); err != nil { return repairBlock(ctx, dir, id) }\nif err := stats.Issue347OutsideChunksErr(); err != nil { return repairWithIgnore(ctx, dir, id, block.IgnoreIssue347OutsideChunk) }\nreturn nil","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := block.VerifyIndex(ctx, logger, indexFn, minTime, maxTime); err != nil {\n    logger.Warn(\"block index verification failed\", \"block\", id, \"err\", err)\n    // inspect joined message to decide repair strategy\n    return markBlockForRepair(ctx, id, err)\n}","preventionTips":["Run bucket verify periodically on object storage blocks","Repair blocks before compaction runs","Upgrade Prometheus to avoid legacy index bugs (issue 347, out-of-order labels <=2.8.0)"],"tags":["tsdb","block-index","thanos","verification","aggregate-error"],"backgroundTag":"schema-validation-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"}