[Bug]: "Waiting for target frame x failed" when crawling a lot of websites concurrently
See original GitHub issueBug description
Steps to reproduce the problem:
- Do a lot at the same time (opening a lot of browsers and visiting pages etc.), causing Node to lag.
- Observe an unhandledRejection like the following:
TimeoutError: Waiting for target frame 38DAB13DFEC9AD09315770D838D9F8C9 failed
at Timeout._onTimeout (path\to\my_package\node_modules\puppeteer\src\util\DeferredPromise.ts:36:14)
at listOnTimeout (node:internal/timers:564:17)
at processTimers (node:internal/timers:507:7)
This is caused by the promise from FrameManager.ts:153 not being fulfilled within 5 seconds (hardcoded in DeferredPromise.ts). If you add if (isRejected) console.log('resolved anyway')
to resolve:
in DeferredPromise.ts and set process.on('uncaughtException', console.error)
then you can see that the promise will be resolved anyway later on.
I think the timeout should probably be configurable in some way (or removed entirely, but it probably serves a purpose).
Puppeteer version
16.2.0
Node.js version
18.7.0
npm version
8.17.0
What operating system are you seeing the problem on?
Windows
Relevant log output
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:6
Top Results From Across the Web
Puppeteer Waiting for target frame Ubuntu digitalocean
It takes a little longer than normal to generate the headless browser but the error is stemming from a timeout happening at page.goto(link)....
Read more >Troubleshooting Inconsistent Web Security Scan Results - Invicti
This is done by reducing the number of concurrent connections the scanner opens with the web application. To decrease the scan speed open...
Read more >Bug listing with status RESOLVED with resolution FIXED as at ...
Bug :2 - "How do I attach an ebuild. ... Bug:468 - "Zope 2.4.0/2.5.0 both give error about Makefile.pre.in not having boot target"...
Read more >How to Bypass Cloudflare: A Comprehensive Guide - ZenRows
Error 1020: Access Denied; Error 1010: The owner of this website has banned ... How long does it take to bypass Cloudflare waiting...
Read more >5 common mistakes with rel=canonical - Google Developers
Double-check that your rel=canonical target exists (it's not an error or " soft 404 "). Verify the rel=canonical target doesn't contain a noindex...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Update: I sometimes have this issue even when I change the timeout to 30 seconds while doing just 5 crawls concurrently, and I can see that the promise would actually be fulfilled eventually.
Sorry, looks like a regression slipped in the @jrandolf’s refactoring https://github.com/puppeteer/puppeteer/pull/8863