JuliusBrussee/caveman · error
cachebench: trace line %d: %w
Error message
cachebench: trace line %d: %w
What it means
Error "cachebench: trace line %d: %w" thrown in JuliusBrussee/caveman.
Source
Thrown at cacheengine/cachebench/trace.go:306
scanner.Buffer(make([]byte, initial), limits.MaxLineBytes)
seen := map[string]bool{}
var records []TraceRecord
for line := 1; scanner.Scan(); line++ {
raw := bytes.TrimSpace(scanner.Bytes())
if len(raw) == 0 {
continue
}
if len(records) >= limits.MaxRecords {
return nil, fmt.Errorf("cachebench: trace exceeds record limit %d", limits.MaxRecords)
}
if !validUniqueJSONObject(raw) {
return nil, fmt.Errorf("cachebench: trace line %d: duplicate or invalid JSON", line)
}
decoder := json.NewDecoder(bytes.NewReader(raw))
decoder.DisallowUnknownFields()
var record TraceRecord
if err := decoder.Decode(&record); err != nil {
return nil, fmt.Errorf("cachebench: trace line %d: %w", line, err)
}
var trailing any
if err := decoder.Decode(&trailing); err != io.EOF {
return nil, fmt.Errorf("cachebench: trace line %d: trailing JSON", line)
}
if record.Schema != TraceSchema && record.Schema != TraceSchemaV2 && record.Schema != TraceSchemaV1 || !validBoundedText(record.RequestID, 512, false) || seen[record.RequestID] {
return nil, fmt.Errorf("cachebench: trace line %d: invalid schema or request_id", line)
}
if _, err := time.Parse(time.RFC3339Nano, record.At); err != nil || !validTraceIdentity(record) || record.PrefixTokens < 0 {
return nil, fmt.Errorf("cachebench: trace line %d: incomplete request identity", line)
}
if len(record.Body) > limits.MaxBodyBytes || !json.Valid(record.Body) || record.BodySHA256 == "" || record.BodySHA256 != bodyDigest(record.Body) {
return nil, fmt.Errorf("cachebench: trace line %d: invalid body or digest", line)
}
if record.StableSegmentCount < 0 || record.StableSegmentCount > len(record.Prefix) || !validPrefix(record.Prefix) {
return nil, fmt.Errorf("cachebench: trace line %d: invalid prefix", line)
}
if record.Schema == TraceSchema || record.Schema == TraceSchemaV2 {View on GitHub (pinned to 27d5a3981a)
Solutions
- Fix the trace line indicated in the error.
When it happens
Trigger: Thrown at cacheengine/cachebench/trace.go:306 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/21cc3686deacc7e2.
Report an issue: GitHub.