thanos-io/thanos · error · ApiError

not supported marker

Error message

not supported marker %v

What it means

markBlock parses the 'action' URL parameter into one of Deletion, NoCompaction or NooCompaction markers; anything else hits the default branch and is rejected as ErrorBadData. The message echoes the unsupported action string verbatim.

Solutions

  1. Use one of the exact supported action values (e.g. 'delete' for Deletion, 'no-compact' for NoCompaction) as defined by parse() in pkg/api/blocks/v1.go
  2. Check the API reference for the Thanos version you run — supported markers have changed over releases
  3. Fix casing/typos in the action path segment
  4. Version-pin clients/scripts to the API version they were written for

Example fix

// before
curl -X POST host/api/v1/blocks/01ARZ3NDEKTSV4RRFFQ69G5FAV/nocompact
// after
curl -X POST host/api/v1/blocks/01ARZ3NDEKTSV4RRFFQ69G5FAV/no-compact
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED_ACTIONS = new Set(['delete', 'no-compact']); // check parse() in pkg/api/blocks/v1.go
if (!SUPPORTED_ACTIONS.has(action)) throw new Error(`unsupported marker: ${action}`);

Type guard

function isSupportedAction(a) { return ['delete','no-compact'].includes(a); }

Try / catch

try {
  const res = await api.markBlock(id, action);
} catch (e) {
  if (/not supported marker/.test(e.message)) { /* map action to a supported value and retry once */ }
  throw e;
}

Prevention

When it happens

Trigger: Calling the block mark endpoint with an action value other than the supported set (e.g. 'delete', 'nocompact', 'remove', uppercase variants, or a typo like 'no-compaction').

Common situations: Following outdated documentation or blog posts that used different action names; building automation against an assumed API surface; casing mistakes since the switch is exact-match.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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

Appendix: source

Thrown at pkg/api/blocks/v1.go:130

	id, err := ulid.Parse(idParam)
	if err != nil {
		return nil, nil, &api.ApiError{Typ: api.ErrorBadData, Err: errors.Errorf("ULID %q is not valid: %v", idParam, err)}, func() {}
	}

	actionType := parse(actionParam)
	switch actionType {
	case Deletion:
		err := block.MarkForDeletion(r.Context(), bapi.logger, bapi.bkt, id, detailParam, promauto.With(nil).NewCounter(prometheus.CounterOpts{}))
		if err != nil {
			return nil, nil, &api.ApiError{Typ: api.ErrorBadData, Err: err}, func() {}
		}
	case NoCompaction:
		err := block.MarkForNoCompact(r.Context(), bapi.logger, bapi.bkt, id, metadata.ManualNoCompactReason, detailParam, promauto.With(nil).NewCounter(prometheus.CounterOpts{}))
		if err != nil {
			return nil, nil, &api.ApiError{Typ: api.ErrorBadData, Err: err}, func() {}
		}
	default:
		return nil, nil, &api.ApiError{Typ: api.ErrorBadData, Err: errors.Errorf("not supported marker %v", actionParam)}, func() {}
	}
	return nil, nil, nil, func() {}
}

func (bapi *BlocksAPI) blocks(r *http.Request) (any, []error, *api.ApiError, func()) {
	viewParam := r.URL.Query().Get("view")
	if viewParam == "loaded" {
		bapi.loadedLock.Lock()
		defer bapi.loadedLock.Unlock()

		return bapi.loadedBlocksInfo, nil, nil, func() {}
	}

	bapi.globalLock.Lock()
	defer bapi.globalLock.Unlock()

	return bapi.globalBlocksInfo, nil, nil, func() {}
}

View on GitHub (pinned to 35b8b99117)