Puppeteer/WPPConnect app deploys successfully but hangs on initialization

grupowking
HOBBY

2 months ago

Hello Railway Team,

I'm trying to deploy a Node.js application (wppconnect-server) that uses Puppeteer to run a headless Chromium instance.

The good news is that after extensive debugging, the project now builds and deploys successfully. The server is active, running, and responds to basic HTTP requests.

The Issue:

When I make an API call to start a new WhatsApp session (which triggers Puppeteer to launch), the process hangs indefinitely. The API immediately responds with a { "status": "INITIALIZING", "qrcode": null } message, but it never progresses to the QRCODE state. The QR code is never generated.

What I've already investigated and confirmed:

  1. Resource Usage: I have monitored the service metrics. During the initialization attempt, memory usage spikes to a stable ~1.1 GB, and my plan has sufficient resources (up to 8GB), so it is not an Out-Of-Memory crash. The process simply hangs at high memory usage.

  2. Puppeteer Arguments: I have modified the application source code to launch Puppeteer with all the standard recommended flags for running in a Docker/serverless environment. This includes: --no-sandbox, --disable-setuid-sandbox, --disable-dev-shm-usage, and --disable-gpu. This did not solve the hanging issue.

  3. Build Process: We have successfully fixed all build-related issues. We tested different Node versions (22 and 20) and resolved multiple TypeScript and Dockerfile configuration errors. The current deployment builds without any errors.

  4. Network: We initially faced some context canceled network errors when pulling the base Docker image, but that seems to be resolved. The current issue is a runtime hang, not a build failure.

Given that the application runs but the internal browser process seems to be silently failing or hanging without crashing the container, I suspect there may be a lower-level environmental issue.

My Request:

Could you please check the internal container or host-level logs for this service? I'm looking for any indication that the process is being throttled, or if there are any security profiles (like seccomp or AppArmor) that might be interfering with Chromium's ability to launch properly.

$10 Bounty

2 Replies

sarahkb125
EMPLOYEE

2 months ago

Hi there - the only logs we expose are the logs in the build/deploy/http log tabs. Opening this up to community as it is likely to do with the actual request being made


Status changed to Awaiting User Response Railway about 2 months ago


2 months ago

personally i have been unsuccessful in running a headless chrome with puppeteer it just times out or crashes the container with no error and no spike in usage

but you can check out this thread https://station.railway.com/questions/timeouts-when-calling-chrome-webdriver-4c5c921a

feel free to mark this answer as Accepted if you found it helpful

thanks

alex