{"record":{"id":"72a774bc555415db","repo":"JuliusBrussee/caveman","slug":"ccr-metadata-get-w","errorCode":null,"errorMessage":"ccr metadata get: %w","messagePattern":"ccr metadata get: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/ccr/store_sqlite.go","lineNumber":484,"sourceCode":"\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\n\tcase err != nil:\n\t\treturn nil, fmt.Errorf(\"ccr metadata get: %w\", err)\n\t}\n\treturn metadata, nil\n}\n\n// PutObject stores one immutable typed working-memory object. Repeated puts of\n// the same content-derived ID are idempotent; currentness changes use\n// SetObjectCurrentness so invalidation stays explicit.\nfunc (s *Store) PutObject(input Object) (string, error) {\n\tobj, err := prepareObject(input)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdeps, err := json.Marshal(obj.Dependencies)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"ccr typed object dependencies: %w\", err)\n\t}\n\tused, err := s.storageBytes()\n\tif err != nil {","sourceCodeStart":466,"sourceCodeEnd":502,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/engine/ccr/store_sqlite.go#L466-L502","documentation":"Wrap in Store.GetMetadata: the SQL scan of the metadata column for the given handle failed for a reason other than 'no rows'. The wrapped error carries the database failure; treat it as storage-layer corruption or access trouble, not a missing handle.","triggerScenarios":"Thrown at engine/ccr/store_sqlite.go:484 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped error for the underlying driver cause","Retry after transient locks clear","Treat metadata as optional where the caller can proceed without compressor metadata"],"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"}