{"record":{"id":"71e355a22ea753fc","repo":"JuliusBrussee/caveman","slug":"cachebench-hugging-face-rows-field-must-be-array","errorCode":null,"errorMessage":"cachebench: Hugging Face rows field must be array","messagePattern":"cachebench: Hugging Face rows field must be array","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cachebench/corpus.go","lineNumber":261,"sourceCode":"\t\tkey, ok := keyToken.(string)\n\t\tif !ok {\n\t\t\treturn nil, errors.New(\"cachebench: invalid Hugging Face rows key\")\n\t\t}\n\t\tif rootKeys[key] {\n\t\t\treturn nil, fmt.Errorf(\"cachebench: duplicate Hugging Face field %q\", key)\n\t\t}\n\t\trootKeys[key] = true\n\t\tif key != \"rows\" {\n\t\t\tvar ignored json.RawMessage\n\t\t\tif err := decoder.Decode(&ignored); err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"cachebench: skip Hugging Face field %q: %w\", key, err)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tfoundRows = true\n\t\tstart, err := decoder.Token()\n\t\tif err != nil || start != json.Delim('[') {\n\t\t\treturn nil, errors.New(\"cachebench: Hugging Face rows field must be array\")\n\t\t}\n\t\tfor decoder.More() {\n\t\t\tvar raw json.RawMessage\n\t\t\tif err := decoder.Decode(&raw); err != nil {\n\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 {","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/cacheengine/cachebench/corpus.go#L243-L279","documentation":"Error \"cachebench: Hugging Face rows field must be array\" thrown in JuliusBrussee/caveman.","triggerScenarios":"Thrown at cacheengine/cachebench/corpus.go:261 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The Hugging Face rows field must be a JSON array."],"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-15T22:17:37.221Z"}