-
Notifications
You must be signed in to change notification settings - Fork 9k
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]: Error: Attempted to use detached Frame 'xxx...xxx' after waking up from standby #12423
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 |
v22.8.0 is only tested against the Chromium version 124.0.6367.91 Can you reproduce the issue using the Chrome for Testing binary that is downloaded by Puppeteer by default? Could you also include the CDP log when the error happens? |
@OrKoN I've updated the working example. The exact version of puppeteer is not that relevant. I had this issue for a year now, including the puppeteer versions within this time. For example, earlier, I've used puppeteer version 21.11.0 with the same issue. Also older Chromium versions have been used, with the same outcome. I have now tried it with the Chrome for Testing binary that is downloaded by Puppeteer by default, as you suggested. The same behavior could be observed, with the output:
Now run with: Puppeteer version: 22.8.0 (unchanged) The CDP log as requested:
|
running with
|
I am able to reproduce on a Mac using the sleep action. It looks like the websocket connection is disconnected (browser.connected === false when the error happens and also the disconnected event is emitted on the browser instance as expected). The disconnect comes from the web socket transport so I am not sure it is fixable, if the socket connection is severed the browser would destroy all automation agents so the only correct way is to re-connect Puppeteer again and set up everything again. You mentioned this worked before? Do you know which version was it? |
For future reference, here is the stacktrace of the socket disconnect:
which indicates that https://github.com/websockets/ws emitted the close event. |
As a workaround, use |
The connection is also closed for a bare ws client:
|
It does not happen for a bare ws server:
so it looks like Chrome disconnects the socket on stanbdy/sleep. |
It happens at least since Chrome 115. |
This is amazing, it works perfectly! |
It's difficult to reconstruct the version, but I can try it. The puppeteer version might be easy to find out. You would be interested in the Chromium version, right? What I can say for sure is the following observation: It seemed to be an OS-dependent issue. On Ubuntu 16.04.6, it worked without any issue with the standby. When I migrated my OS to Debian 11, this issue showed up immediately and I could not fix it. |
As the issue seems independent of puppeteer's version, I would say, that any version listed on https://launchpad.net/ubuntu/xenial/+source/chromium-browser worked properly for Ubuntu 16.04 considering the standby issue, including the latest version 90.0.4430.72-0ubuntu0 for Ubuntu 16.04 (https://launchpad.net/ubuntu/+source/chromium-browser/90.0.4430.72-0ubuntu0.16.04.1). |
@AntonioFavero is your problem also related to standby/reconnection? if not, it is not the same issue, and please file a separate one including a minimal reproducible example. |
Minimal, reproducible example
Error string
Error: Attempted to use detached Frame '6AC522DD7C67F215C5B95D650D0E708B'.
Bug behavior
Background
Procedure:
Error: Attempted to use detached Frame '6AC522DD7C67F215C5B95D650D0E708B'.
This is also the case, after the network connection has been restored.
In earlier puppeteer versions, this worked without any problem.
Currently used software versions:
Expectation
After standby the there should not show up an error, stating that the Frame is detached.
Reality
In reality, the frame is detached and unusable.
Puppeteer configuration file (if used)
No response
Puppeteer version
22.8.0
Node version
20.11.0
Package manager
npm
Package manager version
10.2.4
Operating system
Linux
The text was updated successfully, but these errors were encountered: