ookamiiixd / baileys-api

Simple WhatsApp REST API with multiple device support
MIT License
433 stars 329 forks source link

console errors #136

Closed helpobras closed 1 year ago

helpobras commented 1 year ago

I did the installation procedures and everything went well. makes the connection... sends messages, but the console shows errors, for example:

{ "level": 50, "time": 1675520575797, "pid": 18128, "hostname": "DESKTOP-NBJ41R8", "err": { "type": "PrismaClientKnownRequestError", "message": "\nInvalid model.create() invocation in\nD:\PROJETOS API\baileys\baileys-api\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\nD:\PROJETOS API\baileys\baileys-api\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 (D:\PROJETOS API\baileys\baileys-api\node_modules\@prisma\client\runtime\index.js:34869:13)\n at RequestHandler.handleAndLogRequestError (D:\PROJETOS API\baileys\baileys-api\node_modules\@prisma\client\runtime\index.js:34841:12)\n at RequestHandler.request (D:\PROJETOS API\baileys\baileys-api\node_modules\@prisma\client\runtime\index.js:34836:12)\n at async PrismaClient._request (D:\PROJETOS API\baileys\baileys-api\node_modules\@prisma\client\runtime\index.js:35926:16)\n at async Promise.all (index 1)\n at async EventEmitter.update (D:\PROJETOS API\baileys\baileys-api\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" }

ookamiiixd commented 1 year ago

But does the route working as expected? I think there's some race condition issues, but as long as everything still working as expected, then it's still okay. I'll figure out a way for this later

rsaisankalp commented 1 year ago

getting this error while running create {{BASE_URL}}/sessions/add

probably it is db connect issue. everything .env is seems fine, tried manually as well , it is connecting and migration is also successful , got the tables ported in db..

still getting this error :

pls help

{"level":50,"time":1675336136499,"pid":15487,"hostname":"MacBook-Air.local","err":{"type":"NotFoundError","message":"No Session found","stack":"NotFoundError: No Session found\n at /Users/apple/code/nodejs/baileys-api/node_modules/@prisma/client/runtime/index.js:34062:15\n at async /Users/apple/code/nodejs/baileys-api/node_modules/@prisma/client/runtime/index.js:34060:20\n at async read (/Users/apple/code/nodejs/baileys-api/node_modules/@ookamiiixd/baileys-store/dist/session.js:28:30)\n at async useSession (/Users/apple/code/nodejs/baileys-api/node_modules/@ookamiiixd/baileys-store/dist/session.js:50:20)\n at async createSession (/Users/apple/code/nodejs/baileys-api/dist/wa.js:141:34)","code":"P2025","clientVersion":"4.7.1","name":"NotFoundError"},"msg":"An error occured during session read"}

rsaisankalp commented 1 year ago

Unable to create session

ookamiiixd commented 1 year ago

Unable to create session

I just updated guide in the readme. Could you please try everything again using the updated guide in the readme?

ookamiiixd commented 1 year ago

Closing this due to inactivity