{"record":{"id":"c4a28dd0cdd29908","repo":"JuliusBrussee/caveman","slug":"cachebench-read-observations-w","errorCode":null,"errorMessage":"cachebench: read observations: %w","messagePattern":"cachebench: read observations: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cachebench/observed.go","lineNumber":139,"sourceCode":"\t\tif err := decoder.Decode(&record); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"cachebench: observation line %d: %w\", line, err)\n\t\t}\n\t\tvar trailing any\n\t\tif err := decoder.Decode(&trailing); err != io.EOF {\n\t\t\treturn nil, fmt.Errorf(\"cachebench: observation line %d: trailing JSON\", line)\n\t\t}\n\t\tif record.Schema != ObservationSchema {\n\t\t\treturn nil, fmt.Errorf(\"cachebench: observation line %d: schema %q\", line, record.Schema)\n\t\t}\n\t\tif strings.TrimSpace(record.RequestID) == \"\" || seen[record.RequestID] {\n\t\t\treturn nil, fmt.Errorf(\"cachebench: observation line %d: empty or duplicate request_id\", line)\n\t\t}\n\t\tseen[record.RequestID] = true\n\t\trecord.Usage = append(json.RawMessage(nil), record.Usage...)\n\t\trecords = append(records, record)\n\t}\n\tif err := scanner.Err(); err != nil {\n\t\treturn nil, fmt.Errorf(\"cachebench: read observations: %w\", err)\n\t}\n\tif len(records) == 0 {\n\t\treturn nil, errors.New(\"cachebench: no observation records\")\n\t}\n\tif err := validateObservationRecords(records); err != nil {\n\t\treturn nil, err\n\t}\n\treturn records, nil\n}\n\n// EvaluateObserved evaluates supplied observations without completeness claim.\nfunc EvaluateObserved(records []ObservationRecord, target Target) (Report, error) {\n\tif err := validateTarget(target); err != nil {\n\t\treturn Report{}, err\n\t}\n\tif len(records) == 0 {\n\t\treturn Report{}, errors.New(\"cachebench: no observation records\")\n\t}","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/cacheengine/cachebench/observed.go#L121-L157","documentation":"Error \"cachebench: read observations: %w\" thrown in JuliusBrussee/caveman.","triggerScenarios":"Thrown at cacheengine/cachebench/observed.go:139 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the observations read error (path/permissions) and retry."],"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"}