JuliusBrussee/caveman · error
cachebench: invalid array close
Error message
cachebench: invalid array close
What it means
After an array's elements were consumed, the next decoder token was missing or not the ']' delimiter — the array is unterminated or malformed. Structural guard inside the strict JSON validator's array branch.
Solutions
- Fix the truncated or malformed JSON so every array is closed with ']'
- Re-serialize the body from parsed data instead of hand-editing the raw bytes
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at cacheengine/cachebench/strictjson.go:82 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of JuliusBrussee/caveman@766dce6b13 (2026-08-18).
Data as JSON: /api/errors/a6772a0efa4f6cd9.
Report an issue: GitHub.
Appendix: source
Thrown at cacheengine/cachebench/strictjson.go:82
}
}
closing, err := decoder.Token()
if err != nil || closing != json.Delim('}') {
return errors.New("cachebench: invalid object close")
}
return nil
case '[':
if root {
return errors.New("cachebench: JSON root must be object")
}
for decoder.More() {
if err := validateUniqueJSONValue(decoder, false, depth+1); err != nil {
return err
}
}
closing, err := decoder.Token()
if err != nil || closing != json.Delim(']') {
return errors.New("cachebench: invalid array close")
}
return nil
default:
return errors.New("cachebench: unexpected JSON delimiter")
}
}
View on GitHub (pinned to 766dce6b13)