You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Page.screenshot hangs when main resource does not finish #9757
page.screenshot: Timeout 60000ms exceeded.
at async (webpack://botagent/src/commands/screen.ts:11:52)
at run (webpack://botagent/src/worker/pool.ts:24:28)
at handler (webpack://botagent/src/worker/executor.ts:33:21)
at async (webpack://botagent/src/router/router.ts:26:30)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
})();
All releases after 1.14.1 have this bug. I don't change anything in the software, but when updating to new release, the number of these errors becomes about 50%
Reacted by Zhaopeng XUAN, eevsyukhin and Ben Welsh
Oleg Trifonov (@nexcode) I am not able to reproduce with this snippet, unfortunately. Do you have any more details? We won't be able to help without reproducing the issue.
Yes, it can explain this behavior. But in theory, if goto is interrupted by timeout or throws an error, my code will not reach the screenshot, but will return an error or timeout from goto.
Activity
nexcode commentedon Oct 25, 2021
On older releases, such errors happen, but very rarely.
mxschmitt commentedon Oct 25, 2021
Are you using Docker or launchServer/connect?
Seems related to #9756. Only 1.16+ should be affected.
nexcode commentedon Oct 25, 2021
Don't use Docker. 1.15.x affected
dgozman commentedon Oct 27, 2021
Oleg Trifonov (@nexcode) Do you have a repro script? Without a repro script we cannot reproduce the issue and fix it.
nexcode commentedon Oct 28, 2021
Yes, I have: https://github.com/microsoft/playwright#page-screenshot
dgozman commentedon Oct 29, 2021
Oleg Trifonov (@nexcode) I am not able to reproduce with this snippet, unfortunately. Do you have any more details? We won't be able to help without reproducing the issue.
sohaib17 commentedon Nov 2, 2021
In my case screenshot API is timing out most of the time on pages where request is aborted because of timeout.
For cases like these I tried with CDP
Page.captureScreenshotas well but CDP call never returns.Seems to be because of https://crbug.com/1121612
nexcode commentedon Nov 2, 2021
Yes, it can explain this behavior. But in theory, if goto is interrupted by timeout or throws an error, my code will not reach the screenshot, but will return an error or timeout from goto.
nexcode commentedon Nov 2, 2021
Does this bug occur precisely if there was an error loading the main document (html) or also when loading any resource by the browser?
sohaib17 commentedon Nov 2, 2021
Might be that
gotocompletes fine and then JS in page redirects and starts a new connection.This snippet reproduces the issue at my end (Python 3.8, CentOS 8):
[-]page.screenshot: Timeout[/-][+][Bug]: Page.screenshot hangs when main resource does not finish[/+]palewire commentedon Mar 21, 2022
Maybe this is just superstition talking here, but I downgraded to 1.14.1 as recommended by the OP and my bug here went away immediately.