{"record":{"id":"c20382675e606ddf","repo":"JuliusBrussee/caveman","slug":"cachebench-observation-line-d-schema-q","errorCode":null,"errorMessage":"cachebench: observation line %d: schema %q","messagePattern":"cachebench: observation line (.+?): schema %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cachebench/observed.go","lineNumber":129,"sourceCode":"\t\t}\n\t\tif len(records) >= limits.MaxRecords {\n\t\t\treturn nil, fmt.Errorf(\"cachebench: observations exceed record limit %d\", limits.MaxRecords)\n\t\t}\n\t\tif !validUniqueJSONObject(raw) {\n\t\t\treturn nil, fmt.Errorf(\"cachebench: observation line %d: duplicate or invalid JSON\", line)\n\t\t}\n\t\tdecoder := json.NewDecoder(bytes.NewReader(raw))\n\t\tdecoder.DisallowUnknownFields()\n\t\tvar record ObservationRecord\n\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","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/cacheengine/cachebench/observed.go#L111-L147","documentation":"Error \"cachebench: observation line %d: schema %q\" thrown in JuliusBrussee/caveman.","triggerScenarios":"Thrown at cacheengine/cachebench/observed.go:129 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use the expected observation schema version on the indicated line."],"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"}