{"record":{"id":"b9a1a1c569911b99","repo":"JuliusBrussee/caveman","slug":"ccr-summary-rows-w","errorCode":null,"errorMessage":"ccr summary rows: %w","messagePattern":"ccr summary rows: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/ccr/store_sqlite.go","lineNumber":687,"sourceCode":"\t\t FROM recoveries GROUP BY content_type`)\n\tif err != nil {\n\t\treturn out, fmt.Errorf(\"ccr summary: %w\", err)\n\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":669,"sourceCodeEnd":702,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/engine/ccr/store_sqlite.go#L669-L702","documentation":"rows.Err() after iterating the recoveries GROUP BY query in Store.Summary returned an error, meaning iteration was interrupted mid-scan. Aggregation aborts rather than returning partial totals.","triggerScenarios":"Thrown at engine/ccr/store_sqlite.go:687 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped error for I/O or lock causes","Retry the summary computation","Verify database health if the failure repeats"],"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-14T00:17:10.932Z"}