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
Error: Protocol error (Page.captureScreenshot): Unable to capture screenshot when taking screenshot of a large viewport #5341
Comments
Any updates? I have the same problem |
I'm also having this problem =( |
My guess is that you are nearing the sending/receive limit of websocket messages. I don't know them off the top of my head, but I'm guessing it's either 100Mb or 256Mb. |
Any idea? I got this error too. |
puppeteer version: 2.1.0 |
If anyone wants to test my theory, I'd recommend looping around, taking a screenshot, logging the screenshot's size, and increasing the viewport. |
Puppeteer 3.0.4 FIX: |
Any update on this issue |
I have the same problem, any updates? |
I am seeing similar issues. Any update on this ? Puppeteer - latest version
|
Hi I am experiencing the same issue, any update?
|
Here's where the error is raised in the Chrome source code, I think. This makes it seems like a Chrome issue. |
Seeing this error in long viewports as well. |
Same here. Can't take a screenshot of a large viewport. |
Same here. |
Same here. Run puppeteer with puppeteer-cluster.
Errors: Protocol error (Page.captureScreenshot): Unable to capture screenshot) From dumpio got next messages: ERROR:browser_child_process_host_impl.cc(747)] Terminating child process for bad message: Received bad user message: Validation failed for viz.mojom.CopyOutputResultSender.0 [VALIDATION_ERROR_DESERIALIZATION_FAILED] |
@bmblb Did you solve (somehow) this issue? |
same here |
the problem is still relevant |
Confirm, problem still actual. |
Still hapenning |
The problem is actual |
wtf. just randomly started happening. i was using my script literally minutes before and now i can't use it at all. no idea what's changed. |
Hi everyone! Seems to be i found problem, as i understand for browser rendering important free space in temp directory for shared memory (on centos it's /temp or /dev/shm dir). [WARNING:discardable_shared_memory_manager.cc(197)] Less than 64MB of free space in temporary directory for shared memory files: 29 or It's mean that you should increase tmp directory size. Hope it will help you. Cheers. |
This is working properly |
This doesn't address the underlying issue but I was getting this error and found that when I removed the |
I tried the same method as @alexlonginc mentioned and the error no longer occurred. |
I believe there could be a limit on the browser side about how big a screenshot can be. We will need to investigate. |
thank you so much!! |
This issue is reported on the chrome dev community as well and it is still open. |
I was running pupeteer on lambda function and i got same error. for me this worked. i increased ephemeral storage of lambda. |
Still happens to "puppeteer": "^22.6.0" (npm) in 2024. Removing fullPage:true will get a truncated screenshot, not as intended :-) After wasting one day, I observed that it's related to the hardware. The same web page can be captured with fullPage screenshot on powerful machines but failed on another Azure B1s VM (1 vcpu, 1 GB memory). The same for Playwright. Therefore I can conclude it's a chromium issue. |
@tedyyu : To be clear, do you mean powerful machines running in Azure, or not in the cloud? |
Hi, |
No new info here, just summary with some details of what was already said. SummaryI found in var browser = await puppeteer.launch({
headless: true,
dumpio: true,
args: ['--no-sandbox', '--font-render-hinting=none', '--force-gpu-mem-available-mb=4096']
}); Adding
Adding Beginning with x7 I get a crash of the graphic driver:
... just as said earlier. |
Steps to reproduce
Tell us about your environment:
What steps will reproduce the problem?
Please include code that reproduces the issue.
Here is a code snippet that sets large viewport and is trying to take screenshot of that
What is the expected result?
Screenshot taken
What happens instead?
Exception thrown
Initially I got that exception from a puppeteer which was launched from node express request handler. It failed to take a screenshot of size 700x25000 with same exception. So I tried to figure what's going on and wrote this test script, which worked just fine with same html and same size of the viewport.
Then I tried to increase viewport to some ridiculous number and reproduced the problem.
So screenshot fails inside node express request handler on a viewport 700x25000
and fails outside of the node express but at much higher viewport size, like 10000x50000
So questions are:
trasnform: scale()
to fit content into some reasonable viewport, e.g. UHDThe text was updated successfully, but these errors were encountered: