JuliusBrussee/caveman · error

cachebench: read corpus: %w

Error message

cachebench: read corpus: %w

What it means

Error "cachebench: read corpus: %w" thrown in JuliusBrussee/caveman.

Source

Thrown at cacheengine/cachebench/corpus.go:222

	for line := 1; scanner.Scan(); line++ {
		raw := bytes.TrimSpace(scanner.Bytes())
		if len(raw) == 0 {
			continue
		}
		var wire lmcacheRowWire
		if err := decodeOneJSON(raw, &wire); err != nil {
			return nil, fmt.Errorf("cachebench: corpus line %d: %w", line, err)
		}
		row, err := validateCorpusWire(wire, line-1, limits)
		if err != nil {
			return nil, fmt.Errorf("cachebench: corpus line %d: %w", line, err)
		}
		if err := appendCorpusRow(&rows, sessions, &retainedBytes, row, limits); err != nil {
			return nil, fmt.Errorf("cachebench: corpus line %d: %w", line, err)
		}
	}
	if err := scanner.Err(); err != nil {
		return nil, fmt.Errorf("cachebench: read corpus: %w", err)
	}
	return rows, nil
}

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 {

View on GitHub (pinned to 27d5a3981a)

Solutions

  1. Fix the corpus read error (path/permissions) and retry.

When it happens

Trigger: Thrown at cacheengine/cachebench/corpus.go:222 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/245e6c9fa988b01e. Report an issue: GitHub.