thanos-io/thanos · error

validation error

Error message

validation error

What it means

errValidation is the sentinel returned when a remote-write request fails content validation in the receive handler (e.g. invalid tenant label via IsTenantValid or malformed payload). The HTTP layer maps it to http.StatusBadRequest (handler.go:755); it also wraps the tenant validation failure at handler.go:1155.

Solutions

  1. Fix the client payload (labels, tenant header) causing validation failure.
  2. Check the wrapped message for the specific invalid field.
  3. Do not retry: 400-class errors are permanent for this request.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pkg/receive/handler.go:95 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/c816f1f3f273a152. Report an issue: GitHub.

Appendix: source

Thrown at pkg/receive/handler.go:95

	labelError   = "error"
)

type ReplicationProtocol string

const (
	ProtobufReplication  ReplicationProtocol = "protobuf"
	CapNProtoReplication ReplicationProtocol = "capnproto"
)

var (
	// errConflict is returned whenever an operation fails due to any conflict-type error.
	errConflict = errors.New("conflict")

	errBadReplica  = errors.New("request replica exceeds receiver replication factor")
	errNotReady    = errors.New("target not ready")
	errUnavailable = errors.New("target not available")

	errValidation = errors.New("validation error")
)

type WriteableStoreAsyncClient interface {
	storepb.WriteableStoreClient
	RemoteWriteAsync(context.Context, *storepb.WriteRequest, endpointReplica, []int, chan writeResponse, func(error))
	// TryRemoteWriteAsync submits the request without blocking. Returns false if the peer's
	// worker pool is at capacity; the caller should fall back to RemoteWriteAsync.
	TryRemoteWriteAsync(context.Context, *storepb.WriteRequest, endpointReplica, []int, chan writeResponse, func(error)) bool
}

// Options for the web Handler.
type Options struct {
	Writer                  *Writer
	ListenAddress           string
	Registry                *prometheus.Registry
	TenantHeader            string
	TenantField             string
	DefaultTenantID         string

View on GitHub (pinned to 35b8b99117)