thanos-io/thanos · error

delete file from bucket

Error message

delete file %s from bucket

What it means

Wraps bkt.Delete in RemoveMark when deleting the mark file (deletion, no-compact, or no-downsample) that flags the block. It fires on object-storage errors while removing the already-verified mark, leaving the block still marked.

Solutions

  1. Check bucket delete permissions
  2. Retry after transient storage failures
  3. Check for retention/legal-hold policies blocking deletes
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at pkg/block/block.go:456 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of thanos-io/thanos@35b8b99117 (2026-09-07). Data as JSON: /api/errors/2554894b0ec1aae5. Report an issue: GitHub.

Appendix: source

Thrown at pkg/block/block.go:456

	}
	markedForNoDownsample.Inc()
	level.Info(logger).Log("msg", "block has been marked for no downsample", "block", id)
	return nil
}

// RemoveMark removes the file which marked the block for deletion, no-downsample or no-compact.
func RemoveMark(ctx context.Context, logger log.Logger, bkt objstore.Bucket, id ulid.ULID, removeMark prometheus.Counter, markedFilename string) error {
	markedFile := path.Join(id.String(), markedFilename)
	markedFileExists, err := bkt.Exists(ctx, markedFile)
	if err != nil {
		return errors.Wrapf(err, "check if %s file exists in bucket", markedFile)
	}
	if !markedFileExists {
		level.Warn(logger).Log("msg", "requested to remove the mark, but file does not exist", "err", errors.Errorf("file %s does not exist in bucket", markedFile))
		return nil
	}
	if err := bkt.Delete(ctx, markedFile); err != nil {
		return errors.Wrapf(err, "delete file %s from bucket", markedFile)
	}
	removeMark.Inc()
	level.Info(logger).Log("msg", "mark has been removed from the block", "block", id)
	return nil
}

View on GitHub (pinned to 35b8b99117)