JuliusBrussee/caveman · error

cachebench: invalid Hugging Face rows key

Error message

cachebench: invalid Hugging Face rows key

What it means

Error "cachebench: invalid Hugging Face rows key" thrown in JuliusBrussee/caveman.

Source

Thrown at cacheengine/cachebench/corpus.go:245

func readHFRows(reader io.Reader, limits CorpusLimits) ([]CorpusRow, error) {
	decoder := json.NewDecoder(reader)
	first, err := decoder.Token()
	if err != nil || first != json.Delim('{') {
		return nil, errors.New("cachebench: Hugging Face rows root must be object")
	}
	rows := make([]CorpusRow, 0)
	sessions := map[string]bool{}
	var retainedBytes int64
	foundRows := false
	rootKeys := map[string]bool{}
	for decoder.More() {
		keyToken, err := decoder.Token()
		if err != nil {
			return nil, fmt.Errorf("cachebench: read Hugging Face rows key: %w", err)
		}
		key, ok := keyToken.(string)
		if !ok {
			return nil, errors.New("cachebench: invalid Hugging Face rows key")
		}
		if rootKeys[key] {
			return nil, fmt.Errorf("cachebench: duplicate Hugging Face field %q", key)
		}
		rootKeys[key] = true
		if key != "rows" {
			var ignored json.RawMessage
			if err := decoder.Decode(&ignored); err != nil {
				return nil, fmt.Errorf("cachebench: skip Hugging Face field %q: %w", key, err)
			}
			continue
		}
		foundRows = true
		start, err := decoder.Token()
		if err != nil || start != json.Delim('[') {
			return nil, errors.New("cachebench: Hugging Face rows field must be array")
		}
		for decoder.More() {

View on GitHub (pinned to 27d5a3981a)

Solutions

  1. Fix the rows key in the Hugging Face response parsing configuration.

When it happens

Trigger: Thrown at cacheengine/cachebench/corpus.go:245 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of JuliusBrussee/caveman@27d5a3981a (2026-08-15). Data as JSON: /api/errors/f4a58ac912f02be4. Report an issue: GitHub.