Headless Chrome Timing Out on Dokploy Deployment

I have an issue getting a headless Chrome browser to run in my Ruby on Rails app deployed via Dokploy. The browser times out on all requests when started from the web server, but it works perfectly when launched from the Rails console in the Terminal (via Dokploy UI). The goal is to fetch a remote URL and extract its content. My Docker setup is solid, as the app runs smoothly when built and executed with plain Docker, on Coolify (a competitor), and on my local development machine. The problem appears to be specific to the Dokploy deployment. The only feedback I get from Dokploy logs is a series of messages like:
[1] ! reaped unknown child process pid=1709 status=pid 1709 exit 0
[1] ! reaped unknown child process pid=1805 status=pid 1805 exit 0
(lots more)
[1] ! reaped unknown child process pid=1709 status=pid 1709 exit 0
[1] ! reaped unknown child process pid=1805 status=pid 1805 exit 0
(lots more)
I’m not sure what’s causing this. I'm not even sure it's related to Dokploy. However I'm at my wits end. Anybody have any ideas? Dockerfile: https://pastebin.com/GywVfPT7 Chrome (error) messages when starting (successfully) from Rails console: https://pastebin.com/R7xfT21a
Pastebin
syntax=docker/dockerfile:1# check=error=true# This Dockerfile is ...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin
rails@b26c20becbfa:/rails$ /usr/bin/google-chrome --disable-http2 -...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
26 Replies
Siumauricio
Siumauricio7mo ago
Hi the docker image build was successful? are you deploying in dokploy server or remote?
johannes0910
johannes0910OP7mo ago
Heyo, Yes, the build works fine and my app runs well. I deploy it to my VPS where I run Dokploy. It's the same image I ran on Coolify & on bare metal. Just on Dokploy it fails to execute chrome.
Siumauricio
Siumauricio7mo ago
hmm what did you did on coolify? like any special setting or something?
johannes0910
johannes0910OP7mo ago
exactly the same thing ... I registered my SCM, told it which Dockerfile to use and then I pressed the Deploy button. No special settings, except the usual env variables.
Siumauricio
Siumauricio7mo ago
can you enter to the server and do docker service ls
johannes0910
johannes0910OP7mo ago
docker service ls
ID NAME MODE REPLICAS IMAGE PORTS
ygi3v52pb24t directus-cms-rails-b2ac39 replicated 0/0 directus-cms-rails-b2ac39:latest
y93em5q9kvgu directus-database-45e7db replicated 1/1 pgvector/pgvector:pg16
nllwbpe80bbe dokploy replicated 1/1 dokploy/dokploy:latest
zxc6p2w58m5o dokploy-postgres replicated 1/1 postgres:16
ycri0zszrb28 dokploy-redis replicated 1/1 redis:7
7u3feoorhvz0 dokploy-traefik replicated 1/1 traefik:v3.1.2
moasjrpfwmi8 firerails-postgres-9d7161 replicated 1/1 pgvector/pgvector:pg16
jq9z0vqrpse0 firerails-rails-18eb52 replicated 1/1 firerails-rails-18eb52:latest
do21gulbplh5 firerails-redis-95d863 replicated 1/1 redis:7
docker service ls
ID NAME MODE REPLICAS IMAGE PORTS
ygi3v52pb24t directus-cms-rails-b2ac39 replicated 0/0 directus-cms-rails-b2ac39:latest
y93em5q9kvgu directus-database-45e7db replicated 1/1 pgvector/pgvector:pg16
nllwbpe80bbe dokploy replicated 1/1 dokploy/dokploy:latest
zxc6p2w58m5o dokploy-postgres replicated 1/1 postgres:16
ycri0zszrb28 dokploy-redis replicated 1/1 redis:7
7u3feoorhvz0 dokploy-traefik replicated 1/1 traefik:v3.1.2
moasjrpfwmi8 firerails-postgres-9d7161 replicated 1/1 pgvector/pgvector:pg16
jq9z0vqrpse0 firerails-rails-18eb52 replicated 1/1 firerails-rails-18eb52:latest
do21gulbplh5 firerails-redis-95d863 replicated 1/1 redis:7
` This is what I am expecting. The firerails-rails image hosts chrome
Siumauricio
Siumauricio7mo ago
I guess the firerails-rails-18eb52 is the service which is giving the issues right? if so can you do docker service logs firerails-rails-18eb52
johannes0910
johannes0910OP7mo ago
this is the code which times out: https://pastebin.com/aAps4phn ... nothing special to see here (I think)
Pastebin
Ruby Script for Web Content Extraction## loads the page in puppet...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Siumauricio
Siumauricio7mo ago
can you print the logs?
johannes0910
johannes0910OP7mo ago
not sure ... I think the logs are old? That's the last couple of lines:
firerails-rails-18eb52.1.3cu2vgi83bm9@dokploy | 2024-10-27 05:59:57 +0000 [DEBUG]: JobRun Update (6.2ms) UPDATE "job_runs" SET "end_date" = $1, "result" = $2, "updated_at" = $3 WHERE "job_runs"."id" = $4 [["end_date", "2024-10-27 05:59:56.980209"], ["result", 1], ["updated_at", "2024-10-27 05:59:56.987332"], ["id", 395161]]
firerails-rails-18eb52.1.3cu2vgi83bm9@dokploy | 2024-10-27 05:59:57 +0000 [DEBUG]: TRANSACTION (2.4ms) COMMIT
firerails-rails-18eb52.1.3cu2vgi83bm9@dokploy | [1] === puma shutdown: 2024-10-27 06:00:07 +0000 ===
firerails-rails-18eb52.1.3cu2vgi83bm9@dokploy | [1] - Goodbye!
firerails-rails-18eb52.1.3cu2vgi83bm9@dokploy | [1] - Gracefully shutting down workers...
firerails-rails-18eb52.1.3cu2vgi83bm9@dokploy | 2024-10-27 05:59:57 +0000 [DEBUG]: JobRun Update (6.2ms) UPDATE "job_runs" SET "end_date" = $1, "result" = $2, "updated_at" = $3 WHERE "job_runs"."id" = $4 [["end_date", "2024-10-27 05:59:56.980209"], ["result", 1], ["updated_at", "2024-10-27 05:59:56.987332"], ["id", 395161]]
firerails-rails-18eb52.1.3cu2vgi83bm9@dokploy | 2024-10-27 05:59:57 +0000 [DEBUG]: TRANSACTION (2.4ms) COMMIT
firerails-rails-18eb52.1.3cu2vgi83bm9@dokploy | [1] === puma shutdown: 2024-10-27 06:00:07 +0000 ===
firerails-rails-18eb52.1.3cu2vgi83bm9@dokploy | [1] - Goodbye!
firerails-rails-18eb52.1.3cu2vgi83bm9@dokploy | [1] - Gracefully shutting down workers...
` It's 08:37 now
Siumauricio
Siumauricio7mo ago
hmm i remember someone created a discussion about puppeter, I don't know if could be helpfull https://github.com/Dokploy/dokploy/discussions/372
GitHub
VPS performance issue ? · Dokploy dokploy · Discussion #372
I noted something weird regarding the additional processing head dokploy/containers add on top of vanilla VPS deploy. Here are my 2 identical contabo VPS ( 4vCPU / 6GB RAM / 200 GB ). On first one ...
Siumauricio
Siumauricio7mo ago
did you assign something in advanced settings?
johannes0910
johannes0910OP7mo ago
apart from some volumes, no it's all default
Siumauricio
Siumauricio7mo ago
how do you access it through a url or how?
johannes0910
johannes0910OP7mo ago
From the issue: "Dokploy doesn't do anything than just building the image and running in to a container, so is basically the same thing you run the commands manually in your server, but dokploy automatize that process" That's what I assume too and that's why I don't understand why it doesn't work. It doesn't help me though. My server has 16gb ram and lots of cores. It's not a resource issue. Besides, it works in rails console??? 1) Working: - Dokploy terminal - bin/rails console - ExtractContent.new.fetch_content("https://www.google.com") 2) Not working: - The same ExtractContent.new.fetch_content called via a controller action or background job Both are running in the same container.
Siumauricio
Siumauricio7mo ago
It is correct what you mention about the issue, it is 1:1 construction and execution, it should work, you already had docker installed previously on that machine or it is a new server? And how do you trigger that action? via http or what?
johannes0910
johannes0910OP7mo ago
yes. Controller Actions are HTTP Endpoints, such as /foo Alternatively I start a background job that gets processed in the same process as the webserver. Both fail in production on Dokploy Sample Code that works, in Dev:
def test1
url = "https://www.heise.de"
content = ExtractContent.new.fetch_content(url)

render :plain => content
end
def test1
url = "https://www.heise.de"
content = ExtractContent.new.fetch_content(url)

render :plain => content
end
` Very simple ... it fails / hangs on my VPS
Siumauricio
Siumauricio7mo ago
how did you set the domain? Because I assume you are triggering the container via some url.
johannes0910
johannes0910OP7mo ago
its https://mydomain/test basically. The app works fine.
Siumauricio
Siumauricio7mo ago
hmm have you tried to search something about this: reaped unknown child process pid=1709 status=pid 1709 exit 0 this means there are zombie proceses because I see this on this issue https://github.com/puma/puma/discussions/3420 https://github.com/puma/puma/issues/3313
GitHub
Seeing multiple "reaped unknown child process" messages · puma puma...
When we run application we are seeing multiple logs like "! reaped unknown child process pid=34 status=pid 34 exit 0" is there a way we can disable this log in our application ? To Reprod...
GitHub
Puma cluster not reaping child processes with Puma 6.4.1 · Issue #3...
Describe the bug We have a separate fleet of Puma workers to handle ActionCable, and since upgrading to 6.4.1 we have seen a significant increase of unhealthy pods and can't alloc thread error ...
Siumauricio
Siumauricio7mo ago
I'm not very familiar with rails tbh, I remember someone asked me something similar to that and in the end it was something that had to be done internally in the application. also you already had docker installed previously on that machine or it is a new server?
johannes0910
johannes0910OP7mo ago
it's a brand new Dokploy-online hetzner VPS the Puma threads don't help me, because I don't fully grasp how things work internally. Rails usually works like magic... until it doesn't. Updating to Rails 8 was another thing I wanted to try - but then again, it works on my machine (tm) all I can say now is that my simple demo code outputs 10 warnings(?) like this: [1] ! reaped unknown child process pid=218 status=pid 218 exit 0
Siumauricio
Siumauricio7mo ago
I would like to help you, I think this is a configuration or application problem, do you have a way to reproduce it and with the steps to follow? I am not very familiar with rails. I remember that in go I did something similar that created dead processes, and with some configuration I made that it did not continue happening.
johannes0910
johannes0910OP7mo ago
I have to set up a demo system for that, this will take some time
Siumauricio
Siumauricio7mo ago
Ok, let me know!
johannes0910
johannes0910OP7mo ago
it's really weird, the code now also fails with a normal Docker image on another VPS. So I don't think the issue is particularly related to Dokploy. I created an issue with a minimal sample at the Chrome wrapper lib that I'm using https://github.com/YusukeIwaki/puppeteer-ruby/issues/339
GitHub
Help needed: Pupeteer.launch hangs inside Docker image · Issue #33...
I have an issue getting a headless Chrome browser to run in my Ruby on Rails app deployed via Docker. It times out on all requests when started from the web server, but it works perfectly when laun...

Did you find this page helpful?