Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

model.create(Unique constraint failed on the constraint: PRIMARY #154

Open
hung101 opened this issue Feb 23, 2023 · 2 comments
Open

model.create(Unique constraint failed on the constraint: PRIMARY #154

hung101 opened this issue Feb 23, 2023 · 2 comments

Comments

@hung101
Copy link

hung101 commented Feb 23, 2023

I facing some messages does not store into database which get the error from the logs as following:
image

{"level":50,"time":1677119196345,"pid":14721,"hostname":"Edwards-MacBook-Pro.local","err":{"type":"PrismaClientKnownRequestError","message":"\nInvalid model.create() invocation in\n/Users/edwardtan/Sites/localhost/whatsapp/whatsapp_service/node_modules/@ookamiiixd/baileys-store/dist/handlers/message.js:79:27\n\n 76 },\n 77 },\n 78 }),\n→ 79 model.create(\nUnique constraint failed on the constraint: PRIMARY","stack":"Error: \nInvalid model.create() invocation in\n/Users/edwardtan/Sites/localhost/whatsapp/whatsapp_service/node_modules/@ookamiiixd/baileys-store/dist/handlers/message.js:79:27\n\n 76 },\n 77 },\n 78 }),\n→ 79 model.create(\nUnique constraint failed on the constraint: PRIMARY\n at RequestHandler.handleRequestError (/Users/edwardtan/Sites/localhost/whatsapp/whatsapp_service/node_modules/@prisma/client/runtime/index.js:34869:13)\n at RequestHandler.handleAndLogRequestError (/Users/edwardtan/Sites/localhost/whatsapp/whatsapp_service/node_modules/@prisma/client/runtime/index.js:34841:12)\n at RequestHandler.request (/Users/edwardtan/Sites/localhost/whatsapp/whatsapp_service/node_modules/@prisma/client/runtime/index.js:34836:12)\n at async PrismaClient._request (/Users/edwardtan/Sites/localhost/whatsapp/whatsapp_service/node_modules/@prisma/client/runtime/index.js:35926:16)\n at async Promise.all (index 1)\n at async EventEmitter.update (/Users/edwardtan/Sites/localhost/whatsapp/whatsapp_service/node_modules/@ookamiiixd/baileys-store/dist/handlers/message.js:68:17)","code":"P2002","clientVersion":"4.7.1","meta":{"target":"PRIMARY"}},"msg":"An error occured during message update edward"}

@ookamiiixd
Copy link
Owner

Yes, the store is not stable yet. I'll investigate more to see if there's any solution for this

@hung101
Copy link
Author

hung101 commented Feb 24, 2023

Yes, the store is not stable yet. I'll investigate more to see if there's any solution for this

thank you really appreciate. will wait for the update :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants