thanos-io/thanos · error

failed to unmarshal as 'partial_response_strategy'…

Error message

failed to unmarshal %v as 'partial_response_strategy'. Possible values are %s

What it means

The unquoted partial_response_strategy string (uppercased) has no entry in the PartialResponseStrategy_value enum map, i.e. it is not 'abort' or 'partial'. The input at fault is the strategy string itself; the error lists all valid values so the config can be corrected. Note that an empty string is accepted and defaults to ABORT before this check.

Solutions

  1. Set partial_response_strategy to 'abort' or 'partial' (case-insensitive)
  2. Omit the field to fall back to the default (abort)
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pkg/store/storepb/custom.go:357 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/10dbaff2862c4686. Report an issue: GitHub.

Appendix: source

Thrown at pkg/store/storepb/custom.go:357

func (x *PartialResponseStrategy) UnmarshalJSON(entry []byte) error {
	fieldStr, err := strconv.Unquote(string(entry))
	if err != nil {
		return errors.Wrapf(
			err,
			"failed to unqote %v, in order to unmarshal as 'partial_response_strategy'. Possible values are %s", string(entry), strings.Join(PartialResponseStrategyValues, ","),
		)
	}

	if fieldStr == "" {
		// NOTE: For Rule default is abort as this is recommended for alerting.
		*x = PartialResponseStrategy_ABORT
		return nil
	}

	strategy, ok := PartialResponseStrategy_value[strings.ToUpper(fieldStr)]
	if !ok {
		return errors.Errorf(
			"failed to unmarshal %v as 'partial_response_strategy'. Possible values are %s",
			string(entry),
			strings.Join(PartialResponseStrategyValues, ","),
		)
	}
	*x = PartialResponseStrategy(strategy)
	return nil
}

func (x *PartialResponseStrategy) MarshalJSON() ([]byte, error) {
	return []byte(strconv.Quote(x.String())), nil
}

// PromMatchersToMatchers returns proto matchers from Prometheus matchers.
// NOTE: It allocates memory.
func PromMatchersToMatchers(ms ...*labels.Matcher) ([]LabelMatcher, error) {
	res := make([]LabelMatcher, 0, len(ms))
	for _, m := range ms {

View on GitHub (pinned to 35b8b99117)