-
Notifications
You must be signed in to change notification settings - Fork 18
[Bug] Processor crashes while processing DataObjectsDeleted event #166
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Problem
The Orion processor crashes while processing Storage.DataObjectsDeleted, not immediately followed by VideoDeleted* event in the same block. This happens because the assets being deleted are still referenced by the some video and deleting them would violate the referential constraint on Video table
{"level":1,"time":1691999777087,"ns":"sqd:processor:mapping","msg":"Ids of StorageDataObject entities to remove: 50, 51"}
{"level":5,"time":1691999777119,"ns":"sqd:processor","err":{"query":"COMMIT","driverError":{"length":299,"name":"error","severity":"ERROR","code":"23503","detail":"Key (id)=(50) is still referenced from table \"video\".","schema":"admin","table":"video","constraint":"FK_2db879ed42e3308fe65e6796729","file":"ri_triggers.c","line":"2541","routine":"ri_ReportViolation","stack":"error: update or delete on table \"storage_data_object\" violates foreign key constraint \"FK_2db879ed42e3308fe65e6796729\" on table \"video\"\n at Parser.parseErrorMessage (/orion/node_modules/pg-protocol/dist/parser.js:287:98)\n at Parser.handlePacket (/orion/node_modules/pg-protocol/dist/parser.js:126:29)\n at Parser.parse (/orion/node_modules/pg-protocol/dist/parser.js:39:38)\n at Socket.<anonymous> (/orion/node_modules/pg-protocol/dist/index.js:11:42)\n at Socket.emit (events.js:400:28)\n at addChunk (internal/streams/readable.js:293:12)\n at readableAddChunk (internal/streams/readable.js:267:9)\n at Socket.Readable.push (internal/streams/readable.js:206:10)\n at TCP.onStreamRead (internal/stream_base_commons.js:188:23)"},"length":299,"severity":"ERROR","code":"23503","detail":"Key (id)=(50) is still referenced from table \"video\".","schema":"admin","table":"video","constraint":"FK_2db879ed42e3308fe65e6796729","file":"ri_triggers.c","line":"2541","routine":"ri_ReportViolation","stack":"QueryFailedError: update or delete on table \"storage_data_object\" violates foreign key constraint \"FK_2db879ed42e3308fe65e6796729\" on table \"video\"\n at PostgresQueryRunner.query (/orion/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:211:19)\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (internal/process/task_queues.js:95:5)\n at async PostgresQueryRunner.commitTransaction (/orion/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:144:13)\n at async EntityManager.transaction (/orion/node_modules/typeorm/entity-manager/EntityManager.js:74:13)"}}
make: *** [Makefile:2: process] Error 1
Fix
Unset each asset reference from the respective Video entity before deleting the asset (data object) from db
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working