{"record":{"id":"b82d373d51502e6d","repo":"thanos-io/thanos","slug":"found-overlap-or-error-during-sync-cannot-upload","errorCode":null,"errorMessage":"Found overlap or error during sync, cannot upload compacted block, details: %v","messagePattern":"Found overlap or error during sync, cannot upload compacted block, details: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/shipper/shipper.go","lineNumber":423,"sourceCode":"\t\t\tif !s.uploadCompacted {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\t// Check against bucket if the meta file for this block exists.\n\t\tok, err := s.bucket.Exists(ctx, path.Join(m.ULID.String(), block.MetaFilename))\n\t\tif err != nil {\n\t\t\treturn uploaded, errors.Wrap(err, \"check exists\")\n\t\t}\n\t\tif ok {\n\t\t\tmeta.Uploaded = append(meta.Uploaded, m.ULID)\n\t\t\tcontinue\n\t\t}\n\n\t\t// Skip overlap check if out of order uploads is enabled.\n\t\tif m.Compaction.Level > 1 && !s.allowOutOfOrderUploads {\n\t\t\tif err := checker.IsOverlapping(ctx, m.BlockMeta); err != nil {\n\t\t\t\treturn uploaded, errors.Errorf(\"Found overlap or error during sync, cannot upload compacted block, details: %v\", err)\n\t\t\t}\n\t\t}\n\n\t\tif err := s.upload(ctx, m); err != nil {\n\t\t\tif !s.allowOutOfOrderUploads {\n\t\t\t\treturn uploaded, errors.Wrapf(err, \"upload %v\", m.ULID)\n\t\t\t}\n\n\t\t\t// No error returned, just log line. This is because we want other blocks to be uploaded even\n\t\t\t// though this one failed. It will be retried on second Sync iteration.\n\t\t\tlevel.Error(s.logger).Log(\"msg\", \"shipping failed\", \"block\", m.ULID, \"err\", err)\n\t\t\tuploadErrs++\n\t\t\tcontinue\n\t\t}\n\t\tmeta.Uploaded = append(meta.Uploaded, m.ULID)\n\t\tuploaded++\n\t\ts.metrics.uploads.Inc()\n\t}","sourceCodeStart":405,"sourceCodeEnd":441,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/shipper/shipper.go#L405-L441","documentation":"Returned by Sync when the overlap checker reports that a compacted block (Compaction.Level > 1) overlaps already-shipped blocks and out-of-order uploads are disabled. Sync aborts immediately so the conflicting block is never uploaded, protecting the non-overlapping block invariant in the bucket.","triggerScenarios":"Sync iterates blocks; for a block with Compaction.Level > 1 and s.allowOutOfOrderUploads == false, checker.IsOverlapping returns the overlap error from [901], which Sync re-wraps with this message.","commonSituations":"Backfilled/restored TSDB data overlapping shipped blocks; Prometheus running with overlapping compaction (misconfigured or third-party fork); two sidecars shipping the same TSDB with divergent compaction; snapshot-based recovery producing duplicate ranges.","solutions":["Read the embedded overlap details, identify overlapping ULIDs, and delete the redundant block (local + bucket via `thanos tools bucket rm`).","Re-compact so overlapping blocks merge into one non-overlapping block, then re-run Sync.","Enable --shipper.allow-out-of-order-uploads if your deployment deliberately permits overlaps.","Ensure only one sidecar ships a given TSDB directory and snapshots aren't re-imported over live data."],"exampleFix":"// before\n// Found overlap or error during sync, cannot upload compacted block, details: shipping compacted block 01ARZ... is blocked; overlap spotted: [...]\n// after\n// thanos tools bucket rm --objstore.config-file=bucket.yaml --id=<duplicate-ULID>\n// # or: thanos sidecar ... --shipper.allow-out-of-order-uploads","handlingStrategy":"validation","validationCode":"if blockMeta.Compaction.Level > 1 && !allowOutOfOrder {\n    if err := checker.IsOverlapping(ctx, blockMeta); err != nil {\n        return fmt.Errorf(\"skip upload of %s: %w\", blockMeta.ULID, err)\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := shipper.Sync(ctx); err != nil && strings.Contains(err.Error(), \"overlap\") {\n    // parse ULIDs from details, resolve duplicates (bucket rm / recompact), then re-sync\n    log.Printf(\"overlap conflict requiring manual resolution: %v\", err)\n}","preventionTips":["Validate restored/backfilled blocks don't overlap shipped ranges before adding them","Never re-import snapshots over a live shipped TSDB","Ensure exactly one shipper owns each bucket prefix/TSDB"],"tags":["compaction","overlap","thanos-blocks","upload"],"backgroundTag":"invalid-state-transition","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"}