devlikeapro / waha

WAHA - WhatsApp HTTP API (REST API) that you can configure in a click! Two engines: chromium-based WEBJS and pure-websocket NOWEB
https://waha.devlike.pro/
Apache License 2.0
1.01k stars 306 forks source link

api/{session}/chats/{chat_id}/messages - Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'getChat') #144

Open ehussain opened 1 year ago

ehussain commented 1 year ago

Hello,

We are facing this random error on one of the phone when we try to fetch the messages. Once that happens then session becomes unresponsive and we are not able to send or receive message.

{"statusCode":500,"timestamp":"2023-07-18T09:51:19.479Z","exception":{"stack":"Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'getChat')\n    at __puppeteer_evaluation_script__:2:40\n    at ExecutionContext._evaluateInternal (/app/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async ExecutionContext.evaluate (/app/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16)\n    at async Client.getChatById (/app/node_modules/whatsapp-web.js/src/Client.js:867:20)\n    at async WhatsappSessionWebJSPlus.getChatMessages (/app/dist/core/session.webjs.core.js:138:22)\n    at async /app/node_modules/@nestjs/core/router/router-execution-context.js:46:28\n    at async /app/node_modules/@nestjs/core/router/router-proxy.js:9:17","message":"Evaluation failed: TypeError: Cannot read properties of undefined (reading 'getChat')\n    at __puppeteer_evaluation_script__:2:40","name":"Error"},"request":{"path":"/api/60007/chats/972542298264@c.us/messages?session=60007&chatId=972542298264%40c.us&limit=100","method":"GET","body":{},"query":{"session":"60007","chatId":"972542298264@c.us","limit":"100"}},"version":{"version":"2023.7.16","tier":"PLUS","browser":"/usr/bin/chromium"}}
allburov commented 1 year ago

I think it relates to https://github.com/devlikeapro/whatsapp-http-api/issues/137 too, the session status should be FAILED on that state

devlikepro commented 3 weeks ago

is it good now btw or happens time to time?

patron:PRO