thanos-io/thanos · error

unsupported item type

Error message

unsupported item type %s

What it means

ValidateEnabledItems checks each entry of the index-cache 'enabled_items' list against the valid cache item names (postings, expanded-postings, series for index cache). It returns this error for any item string that is not one of those values, so unknown or mistyped item names abort cache initialization.

Solutions

  1. Use only valid index-cache items: postings, expanded-postings, series.
  2. Remove enabled_items entirely to cache all item types (the default).
  3. Check for stray whitespace or case differences in list entries.

Example fix

// before
index-cache:
  enabled_items: [postings, meta]
// after
index-cache:
  enabled_items: [postings, expanded-postings, series]
Defensive patterns

Strategy: validation

Validate before calling

var validItems = map[string]bool{"postings": true, "expanded-postings": true, "series": true}
for _, it := range enabledItems {
	if !validItems[strings.TrimSpace(it)] {
		return fmt.Errorf("unsupported item type %q; valid: postings, expanded-postings, series", it)
	}
}

Try / catch

if err := storecache.ValidateEnabledItems(items); err != nil {
	if strings.Contains(err.Error(), "unsupported item type") {
		return fmt.Errorf("check enabled_items against index-cache item names: %w", err)
	}
	return err
}

Prevention

When it happens

Trigger: Calling NewIndexCache with config enabled_items containing e.g. 'meta', 'blocks', 'postings ', 'Postings' (case-sensitive), or item names valid only for a different cache (store cache's 'meta'/'bucket facts').

Common situations: Copying enabled_items from a store-gateway cache config into an index cache config; typos; wrong capitalization; trailing whitespace in YAML list items.

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/aa1fef75752e6e87. Report an issue: GitHub.

Appendix: source

Thrown at pkg/store/cache/filter_cache.go:88

	}
}

// FetchMultiSeries fetches multiple series - each identified by ID - from the cache
// and returns a map containing cache hits, along with a list of missing IDs.
func (c *FilteredIndexCache) FetchMultiSeries(ctx context.Context, blockID ulid.ULID, ids []storage.SeriesRef, tenant string) (hits map[storage.SeriesRef][]byte, misses []storage.SeriesRef) {
	if c.seriesEnabled {
		return c.cache.FetchMultiSeries(ctx, blockID, ids, tenant)
	}
	return nil, ids
}

func ValidateEnabledItems(enabledItems []string) error {
	for _, item := range enabledItems {
		switch item {
		// valid
		case CacheTypePostings, CacheTypeExpandedPostings, CacheTypeSeries:
		default:
			return fmt.Errorf("unsupported item type %s", item)
		}
	}
	return nil
}

View on GitHub (pinned to 35b8b99117)