thanos-io/thanos · error

requested to remove the mark, but file does not exist

Error message

requested to remove the mark, but file does not exist

What it means

RemoveMark found no marker file to remove — the requested mark (deletion/no-compact/no-downsample) does not exist on the block. This is a sentinel-condition message for idempotency/awareness, not a storage failure.

Solutions

  1. Nothing to remove — verify the block ID and marker type
  2. List block files to confirm current marks
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at pkg/block/block.go:452 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/5e7c34b7e1542718. Report an issue: GitHub.

Appendix: source

Thrown at pkg/block/block.go:452

	}

	if err := bkt.Upload(ctx, m, bytes.NewBuffer(noDownsampleMark)); err != nil {
		return errors.Wrapf(err, "upload file %s to bucket", m)
	}
	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)