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]: "Waiting for target frame x failed" when crawling a lot of websites concurrently #8832
Comments
Issue #8832 makes a good point that we should not be making implicit assumptions about the client's performance when waiting for internal events. At the same time, we want to be able to get the debug info if some promises never resolve because of missing backend events. This PR adds a variable to turn on timeouts for deferred promises created using `createDebuggableDeferredPromise`. We can use it in our tests to catch never-resolving promises or when reproducing bug reports where Puppeteer hangs indefinitely. Closes #8832
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. |
The worst part - there is no way to catch this error. If it happens node crashes. |
Issue #8832 makes a good point that we should not be making implicit assumptions about the client's performance when waiting for internal events. At the same time, we want to be able to get the debug info if some promises never resolve because of missing backend events. This PR adds a variable to turn on timeouts for deferred promises created using `createDebuggableDeferredPromise`. We can use it in our tests to catch never-resolving promises or when reproducing bug reports where Puppeteer hangs indefinitely. Closes #8832
@ivibe Except |
@stevenwdv yep, there're workarounds, but I meant traditional try ... catch block :) |
@OrKoN I just checked and unfortunately the issue is not fixed in puppeteer 17.1.0. This seems to be a regression compared to 17.0.0. I can reproduce it with the snippet from #8838.
Can this issue be reopened? |
Hi there am using puppeteer version 17.1.0 and Node 18.10.0. Am facing the exact same issue when I am doing a web scrapping concurrently. Is there any fix or workaround for this? It would be so helpful if it can be address as we are facing the issue in a production system. |
@NoelToy |
Thanks, I have already changed the version to 17.1.1 and the issue got resolved. Thanks once again. |
Bug description
Steps to reproduce the problem:
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')
toresolve:
in DeferredPromise.ts and setprocess.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
The text was updated successfully, but these errors were encountered: