waha icon indicating copy to clipboard operation
waha copied to clipboard

[WEBJS] - Chromium fails to launch (EAGAIN / Cannot fork) with 8+ parallel sessions

Open MiwiDots opened this issue 1 year ago • 5 comments

Describe the bug

After testing with several numbers, we observed the following behavior: • With 1–2 numbers, everything works fine. • When we add up to 8–9 numbers, things start acting weird: • Numbers get logged out • Re-login attempts fail • Eventually none of the numbers can send messages anymore • In the dashboard all numbers show as “starting” and stay stuck

We tested both with and without a proxy, and the result is the same.

Version

Get the WAHA version by calling GET /api/version verison 2025.9.4 engine WehJS tier plus

Expected Behavior

All numbers should stay logged in and be able to send messages, regardless of whether we run 2 or 9 numbers in parallel.

Actual Behavior

Once we go beyond 7–8 numbers, sessions begin to log out, re-login attempts fail, and after a short while no messages can be sent. Inspecting the container logs shows repeated Chromium launch failures with Cannot fork and EAGAIN errors.

Relevant Logs

[08:22:04.344] ERROR (WhatsappSession/43): session:session_XXXXXXX - Failed to launch the browser process!
/usr/bin/chromium: 5: /etc/chromium.d/extensions: Cannot fork
/usr/bin/chromium: 121: Cannot fork
/usr/bin/chromium: 123: Cannot fork
[33593:33593:0915/082204.140254:FATAL:third_party/crashpad/crashpad/util/posix/spawn_subprocess.cc:237] posix_spawn /usr/lib/chromium/chrome_crashpad_handler: Resource temporarily unavailable (11)

TROUBLESHOOTING: https://pptr.dev/troubleshooting
...
Error: Failed to launch the browser process! spawn /usr/bin/chromium EAGAIN
    at ChildProcess.onClose (/app/node_modules/@puppeteer/browsers/lib/cjs/launch.js:325:24)
    ...

The error repeats for multiple sessions whenever more than ~8 sessions are started.

Environment • Server Specs: • 400 GB storage • 128 GB RAM • 48 CPU cores • Hardware capacity should not be the issue.

Steps to Reproduce 1. Start with 1–2 numbers → observe normal behavior 2. Gradually increase to 8–9 numbers → observe logouts and failed re-logins 3. Test both with and without proxy → behavior stays the same

Additional Context

This seems related to process limits or Puppeteer/Chromium spawn limits (EAGAIN, Cannot fork). Could this be a resource limit (ulimit, container setting) or session handling issue? Any suggestions on how to raise the process limit or configure Puppeteer to handle >8 concurrent sessions would be appreciated.

patron:PLUS

MiwiDots avatar Sep 17 '25 03:09 MiwiDots

don't put so many numbers on a single worker. Use multiple containers to handle these many workers. It is a workaround if you are looking for an immediate hack.

normalscene avatar Sep 17 '25 09:09 normalscene

what docker engine version do you use? I remember some problem with linux fork and docker limitations try to run another waha container for 9th session

patron:PRO

devlikepro avatar Sep 19 '25 05:09 devlikepro

Hi, We are running Ubuntu 24.04 and Podman version 4.9.3, which should technically be the same.

patron:PLUS

MiwiDots avatar Sep 21 '25 09:09 MiwiDots

it could be something with podman

patron:PRO

devlikepro avatar Sep 22 '25 08:09 devlikepro

So we swapped to docker but i cant test it due to session problem like descripted in . https://github.com/devlikeapro/waha/issues/1386

patron:PLUS

MiwiDots avatar Sep 24 '25 11:09 MiwiDots