{"record":{"id":"d4dcb5ccf0a44417","repo":"JuliusBrussee/caveman","slug":"ccr-get-w","errorCode":null,"errorMessage":"ccr get: %w","messagePattern":"ccr get: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/ccr/store_sqlite.go","lineNumber":464,"sourceCode":"\treturn strings.Contains(text, \"database or disk is full\") || strings.Contains(text, \"sqlite_full\")\n}\n\n// Get returns the exact original bytes for a handle, or ErrNotFound.\nfunc (s *Store) Get(handle string) ([]byte, error) {\n\tif strings.HasPrefix(handle, \"ccr_obj_\") {\n\t\tobj, err := s.GetObject(handle)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn append([]byte(nil), obj.Data...), nil\n\t}\n\tvar original []byte\n\trow := s.db.QueryRow(`SELECT original FROM recoveries WHERE handle = ?`, handle)\n\tswitch err := row.Scan(&original); {\n\tcase errors.Is(err, sql.ErrNoRows):\n\t\treturn nil, ErrNotFound\n\tcase err != nil:\n\t\treturn nil, fmt.Errorf(\"ccr get: %w\", err)\n\t}\n\treturn original, nil\n}\n\n// GetMetadata returns optional compressor metadata stored with a handle. A known\n// handle with no metadata returns nil, nil; an unknown handle returns ErrNotFound.\nfunc (s *Store) GetMetadata(handle string) ([]byte, error) {\n\tif strings.HasPrefix(handle, \"ccr_obj_\") {\n\t\tif _, err := s.GetObject(handle); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, nil\n\t}\n\tvar metadata []byte\n\trow := s.db.QueryRow(`SELECT metadata FROM recoveries WHERE handle = ?`, handle)\n\tswitch err := row.Scan(&metadata); {\n\tcase errors.Is(err, sql.ErrNoRows):\n\t\treturn nil, ErrNotFound","sourceCodeStart":446,"sourceCodeEnd":482,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/engine/ccr/store_sqlite.go#L446-L482","documentation":"Wraps the recoveries-table SELECT failure in Store.Get for a non-object handle. It is not the not-found case (that returns ErrNotFound); it means the query itself failed — locked database, corrupted file, or driver error.","triggerScenarios":"Thrown at engine/ccr/store_sqlite.go:464 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped error for lock/corruption causes","Retry the retrieval once transient locks clear","If the database is corrupt, restore from backup or accept the loss (recovery data is derived)"],"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-23T08:17:48.524Z"}