{"record":{"id":"a7809f74064c9c05","repo":"JuliusBrussee/caveman","slug":"ccr-summary-close-w","errorCode":null,"errorMessage":"ccr summary close: %w","messagePattern":"ccr summary close: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/ccr/store_sqlite.go","lineNumber":690,"sourceCode":"\t}\n\tdefer rows.Close()\n\tfor rows.Next() {\n\t\tvar ct string\n\t\tvar b Bucket\n\t\tif err := rows.Scan(&ct, &b.Count, &b.TokensBefore, &b.TokensAfter); err != nil {\n\t\t\treturn out, fmt.Errorf(\"ccr summary scan: %w\", err)\n\t\t}\n\t\tb.Ratio = ratio(b.TokensBefore, b.TokensAfter)\n\t\tout.ByContentType[ct] = b\n\t\tout.Totals.Count += b.Count\n\t\tout.Totals.TokensBefore += b.TokensBefore\n\t\tout.Totals.TokensAfter += b.TokensAfter\n\t}\n\tif err := rows.Err(); err != nil {\n\t\treturn out, fmt.Errorf(\"ccr summary rows: %w\", err)\n\t}\n\tif err := rows.Close(); err != nil {\n\t\treturn out, fmt.Errorf(\"ccr summary close: %w\", err)\n\t}\n\tout.Totals.Ratio = ratio(out.Totals.TokensBefore, out.Totals.TokensAfter)\n\tused, err := s.storageBytes()\n\tif err != nil {\n\t\treturn out, fmt.Errorf(\"ccr summary storage: %w\", err)\n\t}\n\tout.StorageBytes = used\n\tout.MaxStorageBytes = s.maxBytes\n\tout.StorageFull = used >= s.maxBytes\n\treturn out, nil\n}\n","sourceCodeStart":672,"sourceCodeEnd":702,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/engine/ccr/store_sqlite.go#L672-L702","documentation":"Wraps the explicit rows.Close error in Store.Summary. Closing the cursor released resources but reported an error (pending I/O failure); because it may indicate unread rows, the summary fails rather than reporting possibly-incomplete totals.","triggerScenarios":"Thrown at engine/ccr/store_sqlite.go:690 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped error for the deferred I/O failure","Retry the summary","Investigate database health if close errors persist"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"766dce6b1394ebb56a3090748d5a0240a5aefb36","analyzedAt":"2026-08-18T03:14:35.516Z","contentChangedAt":"2026-08-18T03:14:35.516Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}