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:
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
Hi
the docker image build was successful?
are you deploying in dokploy server or remote?
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.
hmm what did you did on coolify?
like any special setting or something?
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.
can you enter to the server and do docker service ls
`
This is what I am expecting. The firerails-rails image hosts chrome
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-18eb52this 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.
can you print the logs?
not sure ... I think the logs are old? That's the last couple of lines:
`
It's 08:37 now
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 ...
did you assign something in advanced settings?
apart from some volumes, no it's all default
how do you access it through a url or how?
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.
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?
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:
`
Very simple ... it fails / hangs on my VPS
how did you set the domain?
Because I assume you are triggering the container via some url.
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/3313GitHub
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 ...
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?
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
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.
I have to set up a demo system for that, this will take some time
Ok, let me know!
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...