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
878 stars 273 forks source link

Stuck on STARTING #187

Closed gr8tushar closed 11 months ago

gr8tushar commented 1 year ago

Hi, After creating few sessions, when I am creating a new session it is stuck on "STARTING" state. It is not moving to the "SCAN_QR_CODE".

Tried, restarting the docker. All the sessions are stuck in STARTING state.

Here are the details / logs of the docker.

I am using the following version: { "version": "2023.8.23", "tier": "PLUS", "browser": "/usr/bin/chromium" }

I was checking the logs and found this. Could be helpful in debugging. whatsapp-http-api-plus | (node:34) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 12 exit listeners added to [process]. Use emitter.setMaxListeners() to increase limit whatsapp-http-api-plus | (Use node --trace-warnings ... to show where the warning was created) whatsapp-http-api-plus | (node:34) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 12 SIGINT listeners added to [process]. Use emitter.setMaxListeners() to increase limit whatsapp-http-api-plus | (node:34) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 12 SIGTERM listeners added to [process]. Use emitter.setMaxListeners() to increase limit whatsapp-http-api-plus | (node:34) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 12 SIGHUP listeners added to [process]. Use emitter.setMaxListeners() to increase limit

Thanks, Tushar

allburov commented 1 year ago

@gr8tushar could you try to remove .sessions directory and try again? The emmiter warnings shouldn't affect it, may be there's some other logs available?

gr8tushar commented 1 year ago

Hi @allburov - I removed the .sessions directory and restarted the process and everything worked fine.

To figure out the root cause, this is what I tried. This may be of some help to you.

USE CASE :1

I checked the logs are saw that all the sessions are restored asynchronously. If they are restored synchronously, some of them might start.

Will try couple of things and update you.

Best, Tushar

allburov commented 12 months ago

75 MB free memory

Could you try to increase the memory on 2GB (and may be CPU if it's 2 to set them to 4) and try it again? It could be performance issue

allburov commented 12 months ago

The last time we've tested it 10 session require about 2.7 CPU and 1.5 GB of memory https://waha.devlike.pro/docs/overview/faq/#how-much-cpu-and-memory-does-whatsapp-http-api-consume

It might change since then, because there's a lot of changes made in WAHA, engines and WhatsApp itself, so you should try to adjust it for your case

Devanagaraj commented 12 months ago

I am facing same issue on

"version": "2023.7.16", "tier": "PLUS",

server have 5GB of free memory and more than enough of CPU

Steps to reproduce:

  1. Started a session from the swagger panel
  2. Status of that session updated to SCAN_QR_CODE
  3. I scanned the code and checked screenshot of that session after 5 second and it have successfully logged in on web engine.
  4. checked /Sessions endpoint and the status of the session remained as SCAN_QR_CODE even after 5 minute.

Tried 5 times with different session name but Status of session is not updating...

allburov commented 12 months ago

@Devanagaraj it's not the same issue, you have the different status. Scan QR has been fixed in latest version https://github.com/devlikeapro/whatsapp-http-api/issues?q=is%3Aissue+is%3Aclosed

allburov commented 11 months ago

@gr8tushar hi! Any updates after the above suggestion about memory?

dv336699 commented 11 months ago

guys, just wanted to offer a bit of advice, I was using a VPS to run the container and was having all sort of issues, after moving to a dedicated server with 8 core and 32GB everything has started to work as expected

allburov commented 11 months ago

@dv336699 thank you for the feedback! @gr8tushar let us know if increasing CPU and Memory didn't help in your case, we'll look at this futher!