question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: "Waiting for target frame x failed" when crawling a lot of websites concurrently

See original GitHub issue

Bug description

Steps to reproduce the problem:

  1. Do a lot at the same time (opening a lot of browsers and visiting pages etc.), causing Node to lag.
  2. 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:closed
  • Created a year ago
  • Reactions:3
  • Comments:6

github_iconTop GitHub Comments

1reaction
stevenwdvcommented, Aug 24, 2022

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.

0reactions
OrKoNcommented, Sep 2, 2022

Sorry, looks like a regression slipped in the @jrandolf’s refactoring https://github.com/puppeteer/puppeteer/pull/8863

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found