{"record":{"id":"18a7b2d7ac02c699","repo":"JuliusBrussee/caveman","slug":"cachebench-hugging-face-rows-root-must-be-object","errorCode":null,"errorMessage":"cachebench: Hugging Face rows root must be object","messagePattern":"cachebench: Hugging Face rows root must be object","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cachebench/corpus.go","lineNumber":231,"sourceCode":"\t\trow, err := validateCorpusWire(wire, line-1, limits)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"cachebench: corpus line %d: %w\", line, err)\n\t\t}\n\t\tif err := appendCorpusRow(&rows, sessions, &retainedBytes, row, limits); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"cachebench: corpus line %d: %w\", line, err)\n\t\t}\n\t}\n\tif err := scanner.Err(); err != nil {\n\t\treturn nil, fmt.Errorf(\"cachebench: read corpus: %w\", err)\n\t}\n\treturn rows, nil\n}\n\nfunc readHFRows(reader io.Reader, limits CorpusLimits) ([]CorpusRow, error) {\n\tdecoder := json.NewDecoder(reader)\n\tfirst, err := decoder.Token()\n\tif err != nil || first != json.Delim('{') {\n\t\treturn nil, errors.New(\"cachebench: Hugging Face rows root must be object\")\n\t}\n\trows := make([]CorpusRow, 0)\n\tsessions := map[string]bool{}\n\tvar retainedBytes int64\n\tfoundRows := false\n\trootKeys := map[string]bool{}\n\tfor decoder.More() {\n\t\tkeyToken, err := decoder.Token()\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"cachebench: read Hugging Face rows key: %w\", err)\n\t\t}\n\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}","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/cacheengine/cachebench/corpus.go#L213-L249","documentation":"Error \"cachebench: Hugging Face rows root must be object\" thrown in JuliusBrussee/caveman.","triggerScenarios":"Thrown at cacheengine/cachebench/corpus.go:231 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The Hugging Face rows response must be a JSON object at the root."],"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"}