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
[Bug]: Browser gets disconnected in Docker without any errors #12257
Comments
This issue was not reproducible. Please check that your example runs locally and the following:
Once the above checks are satisfied, please edit your issue with the changes and we will |
Thanks for the reproducible example. We had a report about it before but without the reproducible example. Can you confirm that the issue is not reproducible without the '--start-fullscreen' and '--kiosk' flags? |
For me it only happens with those flags on MacOS, without Docker. I see in the logs that some target detach events are sent by the browser. Could you clarify if any of the other flags are relevant for the reproduction of the issue? |
@sangn-splunk could you try the version 22.6.4 that was just released? |
@sangn-splunk yeah but you still cannot evaluate or do anything with the page or the browser because it has disconnected. |
I am not able to reproduce it with default flags only though:
|
Ahh dang I totally missed that the browser is still disconnected :(. I didn't see a stack trace, so I assumed it was all good. This is what I get: Everything seems okay outside a container. The problem is running this inside a container in headful mode.
|
can you try using the Docker image we provide? https://github.com/puppeteer/puppeteer/pkgs/container/puppeteer |
E.g.,
|
although you would probably need headless: true for that but that should behave similar to headful |
Actually, I am able to reproduce this too with the command above. |
Sure! Is it possible to run headful mode with the provided docker image? Do I need xvfb? |
@sangn-splunk you can run |
For what it's worth, this is what seems to be throwing the browser.on('disconnected', async () => {
Error.stackTraceLimit = 100
console.log('disconnected caller', (new Error()).stack)
})
Also this did not happen on Chrome 116.0.5845.96-1 and puppeteer 21.1.0. I hope this helps. |
@sangn-splunk yeah it is the websocket connection being closed by the browser |
It also seems to be happening on this specific page. E.g., it does not happen with wikipedia.org |
So it is a Crash and in Chrome and I see in the bugtracker that it was fixed in M124+. I will try it later. |
Ah nice! I can find more example sites as well. Here's another one: Can you share the link to the bug tracker for this specific issue? |
I also had a |
@sangn-splunk it is not possible to get a page error if the whole browser crashes. I have reproduced it with the build that has crash reporting |
The crash report is not public but the version that is says it is fixed in 124.0.6367.18 |
Unfortunately, it does not look like it has been fixed. |
I filed https://crbug.com/333945847 |
As a workaround, you could try
but it might be important for some Puppeteer features such as network interception. |
the |
🤖 I have created a release *beep* *boop* --- <details><summary>browsers: 2.2.2</summary> ## [2.2.2](browsers-v2.2.1...browsers-v2.2.2) (2024-04-15) ### Bug Fixes * remove NetworkServiceInProcess2 set by default ([#12261](#12261)) ([ff4f70f](ff4f70f)), closes [#12257](#12257) </details> <details><summary>puppeteer: 22.6.5</summary> ## [22.6.5](puppeteer-v22.6.4...puppeteer-v22.6.5) (2024-04-15) ### Miscellaneous Chores * **puppeteer:** Synchronize puppeteer versions ### Dependencies * The following workspace dependencies were updated * dependencies * puppeteer-core bumped from 22.6.4 to 22.6.5 * @puppeteer/browsers bumped from 2.2.1 to 2.2.2 </details> <details><summary>puppeteer-core: 22.6.5</summary> ## [22.6.5](puppeteer-core-v22.6.4...puppeteer-core-v22.6.5) (2024-04-15) ### Bug Fixes * remove NetworkServiceInProcess2 set by default ([#12261](#12261)) ([ff4f70f](ff4f70f)), closes [#12257](#12257) * use setImmediate to reduce flakiness when processing events ([#12264](#12264)) ([73403b3](73403b3)) ### Dependencies * The following workspace dependencies were updated * dependencies * @puppeteer/browsers bumped from 2.2.1 to 2.2.2 </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Minimal, reproducible example
Error string
Error: Requesting main frame too early!
Bug behavior
Background
The example used totally works when running outside a docker container, but fails for
Error: Requesting main frame too early!
when inside a container.Chrome
116.0.5845.96-1
and puppeteer21.1.0
were working for us, but we started seeing this on Chrome121.0.6167.184-1
and puppeteer21.9.0
. This is also happening on Chrome 123 and puppeteer22.6.3
.This is the dockerfile used to create the issue. It uses a local .deb file for specific chrome versions. I got this directly from google:
wget "http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_123.0.6312.105-1_amd64.deb"
Build:
docker build -t puppeteer-example
Run:
docker run -d --name puppeteer-example puppeteer-example
Then exec into the container and run the example:
docker exec -it SHA_GOES_HERE /bin/sh
$ xvfb-run node test.js
What's interesting is version
google-chrome-stable_116.0.5845.96-1
of Chrome and puppeteer21.1.0
does not have this error.Expectation
I shouldn't see
Error: Requesting main frame too early
, but I do. It seems like something is disconnecting puppeteer too early resulting in this error, but I don't know what.Reality
I see
Error: Requesting main frame too early!
Puppeteer configuration file (if used)
No response
Puppeteer version
22.6.3
Node version
20.12.2
Package manager
npm
Package manager version
10.5.0
Operating system
Linux
The text was updated successfully, but these errors were encountered: