Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random browserClose after unspecified amount of time #2052

Closed
netomarchiori opened this issue Feb 2, 2024 · 10 comments
Closed

Random browserClose after unspecified amount of time #2052

netomarchiori opened this issue Feb 2, 2024 · 10 comments
Labels
bug Something isn't working needs triage

Comments

@netomarchiori
Copy link

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 netomarchiori added bug Something isn't working needs triage labels Feb 2, 2024
@zanniboni
Copy link

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

@netomarchiori
Copy link
Author

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

@sidd82
Copy link

sidd82 commented Feb 8, 2024

which api are you using @netomarchiori

@zanniboni
Copy link

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

@netomarchiori
Copy link
Author

I've moved to Evolution API @sidd82

@sidd82
Copy link

sidd82 commented Feb 8, 2024

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

@netomarchiori
Copy link
Author

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

@momokang
Copy link

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

@claudioscarpafilho
Copy link

Mesmo problema aqui.
Começou a ocorrer ontem.

@icleitoncosta
Copy link
Contributor

Please, try:
#2091

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

6 participants