wppconnect icon indicating copy to clipboard operation
wppconnect copied to clipboard

Random browserClose after unspecified amount of time

Open netomarchiori opened this issue 1 year ago • 8 comments

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

  1. Clean git pull on wppconnect-server
  2. Set the configs, added "'--disable-features=LeakyPeeker'" to the browserArgs array
  3. build with npm run build
  4. 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?

netomarchiori avatar Feb 02 '24 17:02 netomarchiori

Hi, were you able to find a solution for this? Its happening with me with the latest version

zanniboni avatar Feb 07 '24 00:02 zanniboni

@zanniboni sadly not...I've given up on wppconnect and moved to another api

netomarchiori avatar Feb 07 '24 02:02 netomarchiori

which api are you using @netomarchiori

sidd82 avatar Feb 08 '24 11:02 sidd82

I gave up using wppconnect, i moved my project to use whatsapp-web-js - way better, at least the code looks prettier hahaha

zanniboni avatar Feb 08 '24 12:02 zanniboni

I've moved to Evolution API @sidd82

netomarchiori avatar Feb 08 '24 12:02 netomarchiori

@netomarchiori i tried redeploying the wppconnect and it worked for me

sidd82 avatar Feb 08 '24 12:02 sidd82

I tried to redeploy, update, clean install...nothing worked

netomarchiori avatar Feb 08 '24 12:02 netomarchiori

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..

momokang avatar Feb 13 '24 09:02 momokang

Mesmo problema aqui. Começou a ocorrer ontem.

claudioscarpafilho avatar Apr 06 '24 12:04 claudioscarpafilho

Please, try: https://github.com/wppconnect-team/wppconnect/pull/2091

icleitoncosta avatar Apr 12 '24 15:04 icleitoncosta