{"record":{"id":"d8953bc8ef6b4d81","repo":"thanos-io/thanos","slug":"cleaning-marked-blocks","errorCode":null,"errorMessage":"cleaning marked blocks","messagePattern":"cleaning marked blocks","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/compact/compact.go","lineNumber":1575,"sourceCode":"\t\t\t\t\t}\n\t\t\t\t\terrChan <- errors.Wrapf(err, \"group %s\", g.Key())\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\t// Blocks that were compacted are garbage collected after each Compaction.\n\t\t// However if compactor crashes we need to resolve those on startup.\n\t\tlevel.Info(c.logger).Log(\"msg\", \"start initial sync of metas\")\n\t\tif err := c.sy.SyncMetas(ctx); err != nil {\n\t\t\treturn errors.Wrap(err, \"sync\")\n\t\t}\n\n\t\tvar ignoreBlocks map[ulid.ULID]struct{}\n\t\tif c.blocksCleaner != nil {\n\t\t\tdeletedBlocks, err := c.blocksCleaner.DeleteMarkedBlocks(ctx)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrap(err, \"cleaning marked blocks\")\n\t\t\t}\n\t\t\tignoreBlocks = deletedBlocks\n\t\t}\n\n\t\tlevel.Info(c.logger).Log(\"msg\", \"start of initial garbage collection\")\n\t\tif err := c.sy.GarbageCollect(ctx, ignoreBlocks); err != nil {\n\t\t\treturn errors.Wrap(err, \"garbage\")\n\t\t}\n\n\t\tgroups, err := c.grouper.Groups(c.sy.Metas())\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"build compaction groups\")\n\t\t}\n\n\t\tignoreDirs := []string{}\n\t\tfor _, gr := range groups {\n\t\t\tfor _, grID := range gr.IDs() {\n\t\t\t\tignoreDirs = append(ignoreDirs, filepath.Join(gr.Key(), grID.String()))","sourceCodeStart":1557,"sourceCodeEnd":1593,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/compact/compact.go#L1557-L1593","documentation":"Wraps blocksCleaner.DeleteMarkedBlocks in the compactor startup path: deleting blocks that carry deletion marks from object storage failed. Marked blocks remain, which normally only delays cleanup rather than corrupting state, so the error surfaces for operator attention.","triggerScenarios":"Thrown at pkg/compact/compact.go:1575 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check bucket delete permissions","Inspect the wrapped error for the failing block","Retry next compaction cycle"],"exampleFix":null,"handlingStrategy":"retry","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"}