{"record":{"id":"a55be2a65d5b906b","repo":"JuliusBrussee/caveman","slug":"cachebench-malformed-hugging-face-rows-array","errorCode":null,"errorMessage":"cachebench: malformed Hugging Face rows array","messagePattern":"cachebench: malformed Hugging Face rows array","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cachebench/corpus.go","lineNumber":284,"sourceCode":"\t\t\t\treturn nil, fmt.Errorf(\"cachebench: decode Hugging Face row: %w\", err)\n\t\t\t}\n\t\t\tif len(raw) > limits.MaxRowBytes {\n\t\t\t\treturn nil, fmt.Errorf(\"cachebench: Hugging Face row exceeds %d bytes\", limits.MaxRowBytes)\n\t\t\t}\n\t\t\tvar wire hfRowWire\n\t\t\tif err := decodeOneJSON(raw, &wire); err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"cachebench: decode Hugging Face row: %w\", err)\n\t\t\t}\n\t\t\trow, err := validateCorpusWire(wire.Row, wire.RowIndex, limits)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"cachebench: Hugging Face row %d: %w\", wire.RowIndex, err)\n\t\t\t}\n\t\t\tif err := appendCorpusRow(&rows, sessions, &retainedBytes, row, limits); err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"cachebench: Hugging Face row %d: %w\", wire.RowIndex, err)\n\t\t\t}\n\t\t}\n\t\tif end, err := decoder.Token(); err != nil || end != json.Delim(']') {\n\t\t\treturn nil, errors.New(\"cachebench: malformed Hugging Face rows array\")\n\t\t}\n\t}\n\tif end, err := decoder.Token(); err != nil || end != json.Delim('}') {\n\t\treturn nil, errors.New(\"cachebench: malformed Hugging Face rows object\")\n\t}\n\tvar trailing any\n\tif err := decoder.Decode(&trailing); err != io.EOF {\n\t\treturn nil, errors.New(\"cachebench: trailing JSON after Hugging Face rows object\")\n\t}\n\tif !foundRows {\n\t\treturn nil, errors.New(\"cachebench: Hugging Face response has no rows field\")\n\t}\n\treturn rows, nil\n}\n\nfunc decodeOneJSON(raw []byte, destination any) error {\n\tif !validUniqueJSONObject(raw) {\n\t\treturn errors.New(\"duplicate or invalid JSON\")","sourceCodeStart":266,"sourceCodeEnd":302,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/cacheengine/cachebench/corpus.go#L266-L302","documentation":"Error \"cachebench: malformed Hugging Face rows array\" thrown in JuliusBrussee/caveman.","triggerScenarios":"Thrown at cacheengine/cachebench/corpus.go:284 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the malformed Hugging Face rows array JSON."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"27d5a3981a347890211bb1bf2439e5c821a63bc9","analyzedAt":"2026-08-15T09:26:11.751Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}