{"record":{"id":"ffa832f40b9f84b2","repo":"JuliusBrussee/caveman","slug":"ccr-typed-object-dependencies-decode-w","errorCode":null,"errorMessage":"ccr typed object dependencies decode: %w","messagePattern":"ccr typed object dependencies decode: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/ccr/store_sqlite.go","lineNumber":564,"sourceCode":"}\n\nfunc scanObject(scanner interface{ Scan(...any) error }) (Object, error) {\n\tvar obj Object\n\tvar created, deps string\n\tif err := scanner.Scan(\n\t\t&obj.ID, &obj.Type, &obj.ContentHash, &obj.Source, &created, &obj.RepositoryState,\n\t\t&obj.SessionID, &obj.TransformVersion, &obj.Currentness, &obj.Lifecycle, &deps,\n\t\t&obj.OriginalByteLength, &obj.StoredByteLength, &obj.Data,\n\t); err != nil {\n\t\treturn Object{}, err\n\t}\n\tparsed, err := time.Parse(time.RFC3339Nano, created)\n\tif err != nil {\n\t\treturn Object{}, fmt.Errorf(\"ccr typed object created_at: %w\", err)\n\t}\n\tobj.CreatedAt = parsed\n\tif err := json.Unmarshal([]byte(deps), &obj.Dependencies); err != nil {\n\t\treturn Object{}, fmt.Errorf(\"ccr typed object dependencies decode: %w\", err)\n\t}\n\treturn obj, nil\n}\n\nconst objectColumns = `object_id, object_type, content_hash, source, created_at,\n repository_state, session_id, transform_version, currentness, lifecycle,\n dependencies_json, original_byte_length, stored_byte_length, data`\n\nfunc (s *Store) GetObject(id string) (Object, error) {\n\tobj, err := scanObject(s.db.QueryRow(`SELECT `+objectColumns+` FROM typed_objects WHERE object_id = ?`, id))\n\tif errors.Is(err, sql.ErrNoRows) {\n\t\treturn Object{}, ErrNotFound\n\t}\n\tif err != nil {\n\t\treturn Object{}, fmt.Errorf(\"ccr typed object get: %w\", err)\n\t}\n\treturn obj, nil\n}","sourceCodeStart":546,"sourceCodeEnd":582,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/engine/ccr/store_sqlite.go#L546-L582","documentation":"Wraps the json.Unmarshal failure on the dependencies_json column in scanObject. The stored dependency list is not valid JSON (corrupt or hand-edited row), so the typed object cannot be reconstructed and the read fails closed.","triggerScenarios":"Thrown at engine/ccr/store_sqlite.go:564 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Repair or delete the row with the malformed dependencies_json","Write objects only through PutObject so dependencies are marshaled correctly","Treat persistent decode failures as database corruption and recreate the store"],"exampleFix":null,"handlingStrategy":"validation","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"}