wppconnect
wppconnect copied to clipboard
Random browserClose after unspecified amount of time
Description
Browser opened by Puppeteer seems to be closing after unspecified amount of time, causing the whatsapp I to stop working
Environment
- Wppconnect-server version(s): 2.4.0
- Browser: Chromium 1:85.0.4183.83-0ubuntu0.20.04.3
- OS: Ubuntu 20
- Node version: 18.17.1
- WhatsApp version: 2.2404.x
- MultiDevice (BETA): yes/no (unsure on how/where to check)
Steps to Reproduce
- Clean git pull on wppconnect-server
- Set the configs, added "'--disable-features=LeakyPeeker'" to the browserArgs array
- build with npm run build
- Schedule to run with pm2
After a random amount of time (sometimes 30min, sometime a couple of hours), all I get is "Page Closed" followed by browserClose. And wppconnect-server stops working
Log Output
36mverbose[39m: [main:page] Page Closed
[32minfo[39m: 2024-01-29T09:00:07.027Z browserClose
[31merror[39m: 2024-01-29T11:15:16.581Z Requesting main frame too early! - Error: Requesting main frame too early!
at assert (/home/marchiori/wppconnect-server/node_modules/puppeteer-core/src/util/assert.ts:19:11)
at FrameManager.mainFrame (/home/marchiori/wppconnect-server/node_modules/puppeteer-core/src/cdp/FrameManager.ts:261:11)
at CdpPage.mainFrame (/home/marchiori/wppconnect-server/node_modules/puppeteer-core/src/cdp/Page.ts:481:31)
at CdpPage.evaluate (/home/marchiori/wppconnect-server/node_modules/puppeteer-core/src/api/Page.ts:2106:23)
at /home/marchiori/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/api/helpers/evaluate-and-return.js:99:56
at step (/home/marchiori/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/api/helpers/evaluate-and-return.js:49:23)
at Object.next (/home/marchiori/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/api/helpers/evaluate-and-return.js:30:53)
at /home/marchiori/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/api/helpers/evaluate-and-return.js:24:71
at new Promise (<anonymous>)
at __awaiter (/home/marchiori/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/api/helpers/evaluate-and-return.js:20:12)
at evaluateAndReturn (/home/marchiori/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/api/helpers/evaluate-and-return.js:71:12)
at Whatsapp.<anonymous> (/home/marchiori/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/api/layers/host.layer.js:594:82)
at step (/home/marchiori/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/api/layers/host.layer.js:60:23)
at Object.next (/home/marchiori/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/api/layers/host.layer.js:41:53)
at /home/marchiori/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/api/layers/host.layer.js:35:71
at new Promise (<anonymous>)
at __awaiter (/home/marchiori/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/api/layers/host.layer.js:31:12)
at Whatsapp.isConnected (/home/marchiori/wppconnect-server/node_modules/@wppconnect-team/wppconnect/dist/api/layers/host.layer.js:591:16)
at statusConnection (/home/marchiori/wppconnect-server/src/middleware/statusConnection.ts:29:24)
at Layer.handle [as handle_request] (/home/marchiori/wppconnect-server/node_modules/express/lib/router/layer.js:95:5)
at next (/home/marchiori/wppconnect-server/node_modules/express/lib/router/route.js:144:13)
at /home/marchiori/wppconnect-server/src/middleware/auth.ts:75:11
Log Output
If relevant, paste all of your Log Output
Your Code
Using wppconnect-server default setup
Additional context / Screenshot
How can I help with triage?
Hi, were you able to find a solution for this? Its happening with me with the latest version
@zanniboni sadly not...I've given up on wppconnect and moved to another api
which api are you using @netomarchiori
I gave up using wppconnect, i moved my project to use whatsapp-web-js - way better, at least the code looks prettier hahaha
I've moved to Evolution API @sidd82
@netomarchiori i tried redeploying the wppconnect and it worked for me
I tried to redeploy, update, clean install...nothing worked
I gave up using wppconnect, i moved my project to use whatsapp-web-js - way better, at least the code looks prettier hahaha
Sadly, rewrite everything will cost me a lot of time, I hope it can be support continuously..
Mesmo problema aqui. Começou a ocorrer ontem.
Please, try: https://github.com/wppconnect-team/wppconnect/pull/2091