-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Browser randomly fails to start in docker container #3
Comments
How much RAM does your system have? Could you try to add |
Currently the VM has 8GB RAM and half of it is free. I sure can increase the shared memory size for that, but I'm not really sure how that should help. I tried it and even the very first run failed. The browser starts successfully 1 time and then fails to start 3 times on 4 different runs (it was doing the same thing with headless browser when X was not part of the docker image). I've fixed the issue by simply doing try except on the start call and doing max 5 retries before giving up and it works, so memory doesn't seem to be the issue here. |
Yeah I am on latest version. The related issues that you marked are actually 2 separate issues. Anyway I noticed even on stackoverflow that some people have this issue randomly with nodriver with no reliable solution. |
Ok I was able to reproduce the issue on a VM with just 2 cores and 1GB of RAM. |
fyi: Yesterday it stopped happening completely on the original VM. But it happened on dedicated machine with 128 GB RAM and 10 cores / 20 threads. It's completely random for me. |
Ok I have narrowed down the issue, nodriver doesn't wait enough time before giving up trying to connect chromium instance: https://github.com/ultrafunkamsterdam/nodriver/blob/main/nodriver/core/browser.py#L340-L346 I have pushed a dirty patch in the Dockerfile for waiting more time: 0551c92#diff-dd2c0eb6ea5cfc6c4bd4eac30934e2d5746747af48fef6da689e85b752f39557R22. I validated that it works fine on my VM with 2vCPU and 1GB of RAM. But I'm waiting for an official implementation, for which I have created a PR: |
Hi, even with the dirty patch and also when increasing the sleep time further, I still get the same error. Did anyone encounter this issues in other settings/has fixes for them? Thanks! |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
I have tested the change of wait time but there was no change. |
The token should be invalid if headless is true. Did it work for you? |
same thing happend with my vps too
|
Just wanted to chip in here that I was having the same issue. I found this thread and the |
Trying Do you know what CPU do you have on that host? I'm running on baremetal with an older |
The box is running an |
When running the docker container the browser fails to start quite often throwing the following exception:
Catching the exception and trying again after 3 seconds until it succeeds seems to fix this issue.
The text was updated successfully, but these errors were encountered: