zachpmanson / penultimate-guitar

A streamlined Ultimate Guitar client with Spotify integration
https://pg.zachmanson.com
MIT License
6 stars 5 forks source link

Prisma upsert errors occasionally #46

Closed zachpmanson closed 6 months ago

zachpmanson commented 1 year ago

Need to check if this is due to UG rate limiting or something else

zachpmanson commented 1 year ago
Unhandled Promise Rejection     {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"Error: \nInvalid `prisma.tab.upsert()` invocation:\n\n\nUnique constraint failed on the fields: (`taburl`)","reason":{"errorType":"Error","errorMessage":"\nInvalid `prisma.tab.upsert()` invocation:\n\n\nUnique constraint failed on the fields: (`taburl`)","code":"P2002","clientVersion":"4.12.0","meta":{"target":["taburl"]},"stack":["Error: ","Invalid `prisma.tab.upsert()` invocation:","","","Unique constraint failed on the fields: (`taburl`)","    at fn.handleRequestError (/var/task/node_modules/@prisma/client/runtime/library.js:174:6477)","    at fn.handleAndLogRequestError (/var/task/node_modules/@prisma/client/runtime/library.js:174:5907)","    at fn.request (/var/task/node_modules/@prisma/client/runtime/library.js:174:5786)","    at async t._request (/var/task/node_modules/@prisma/client/runtime/library.js:177:10477)"]},"promise":{},"stack":["Runtime.UnhandledPromiseRejection: Error: ","Invalid `prisma.tab.upsert()` invocation:","","","Unique constraint failed on the fields: (`taburl`)","    at process.<anonymous> (file:///var/runtime/index.mjs:1189:17)","    at process.emit (node:events:525:35)","    at emit (node:internal/process/promises:149:20)","    at processPromiseRejections (node:internal/process/promises:283:27)","    at process.processTicksAndRejections (node:internal/process/task_queues:96:32)"]}
zachpmanson commented 1 year ago

Insertion errors should not result in 500 errors anymore, all are caught (and it doesn't really matter from a user perspective if the insertion fails, it will just pull it again next time someone attempts to load that tab)

zachpmanson commented 1 year ago

This doesn't solve the underlying issues though

zachpmanson commented 1 year ago

A few different kinds of errors: