Skip to content
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

Too large write data is pending: size=725124416, max_buffer_size=268435456 #4563

Closed
vadnala opened this issue Jun 10, 2019 · 6 comments · Fixed by #4587
Closed

Too large write data is pending: size=725124416, max_buffer_size=268435456 #4563

vadnala opened this issue Jun 10, 2019 · 6 comments · Fixed by #4587
Labels
chromium Issues with Puppeteer-Chromium feature upstream

Comments

@vadnala
Copy link

vadnala commented Jun 10, 2019

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 1.2.0
  • Platform / OS version: Windows Server 2008
  • URLs (if applicable):
  • Node.js version: 8.9.1

What steps will reproduce the problem?
When printing web pages that contains hundreds of images.
Even tried the "pipe" mode but no avail. If this is a limitation, is there a way to find the size of the write data as it is obviously printing the following statement on the console window

[0609/223146.069:ERROR:http_connection.cc(112)] Too large write data is pending: size=725124416, max_buffer_size=268435456

Tried Network.dataReceived option to read the data lengths to get to the overall size but the data size does not match. In my case, I got the data as 521 MB but the write data says 691 MB.

Attached a picture of the Network tab on the devTools. It says 521 MB resources which is correctly matching my reading. However, it says 252 MB transferred. How do I get this reading? Either way, how do I get the write data size?
Screen Shot 2019-06-10 at 9 01 44 AM

What is the expected result?
Successfully generate the PDF irrespective of the size of the write data. Else, way to know the size of the write data so that we can document the known limitations.

What happens instead?
Fails to generate the PDF when the page contains of hundreds of images. In other words, when the write data is too large.

@aslushnikov
Copy link
Contributor

@vadnala You're hitting the limit on Chrome DevTools WebSocket: https://cs.chromium.org/chromium/src/content/browser/devtools/devtools_http_handler.cc?sq=package:chromium&g=0&l=83-84

In other words, DevTools protocol messages are limited to 256Mb in DevTools->Clients direction.

The limit will go away once we teach Chromium to return PDFs as streams: https://crbug.com/748956

@aslushnikov aslushnikov added chromium Issues with Puppeteer-Chromium feature upstream labels Jun 11, 2019
@vadnala
Copy link
Author

vadnala commented Jun 11, 2019

@aslushnikov Thanks for the reply and pointers. For time being (workaround), I am looking for an answer to either of these three

  1. Is there a way to find the size of the write data so that I can split the prints accordingly.

  2. I was able to get the resources size capturing the "dataLength" from Network.dataReceived but how do I capture the data transferred so that I can sum up to get the size of the write data

  3. Is there a way to capture the below error message

[0609/223146.069:ERROR:http_connection.cc(112)] Too large write data is pending: size=725124416, max_buffer_size=268435456

@aslushnikov
Copy link
Contributor

@vadnala the fix is already landing in chromium: https://chromium-review.googlesource.com/c/chromium/src/+/1652155

We'll have it in Puppeteer shortly (in a few days) and it will be available right away on npm as puppeteer@next.

@vadnala
Copy link
Author

vadnala commented Jun 11, 2019

@aslushnikov That's great news and many thanks for the update.

We have a customer issue and thus looking for a quick workaround.
Any option to get the size of the "write data" one or the other way?
Thanks in advance.

@aslushnikov
Copy link
Contributor

Any option to get the size of the "write data" one or the other way?
Thanks in advance.

Unfortunately I can't think of any good way to handle this. The best you can rely upon is parsing the stdout/stderr of the chrome process itself.

@vadnala
Copy link
Author

vadnala commented Jun 11, 2019

Any sample/example on how we can parse/capture "chrome" stdout / stderr from puppeteer? TIA

aslushnikov added a commit to aslushnikov/puppeteer that referenced this issue Jun 13, 2019
This roll includes:
- https://crrev.com/c/1652559 - inspector: fix queryObjects when page contains JSModuleNamespace
- https://crrev.com/c/1649473 - [heapprofiler] QueryObjects: do not return objects retained by feedback information
- https://crrev.com/c/1652155 - DevTools: teach page.printToPDF to return IO::Stream

References puppeteer#4563
Fix puppeteer#4545
aslushnikov added a commit that referenced this issue Jun 14, 2019
This roll includes:
- https://crrev.com/c/1652559 - inspector: fix queryObjects when page contains JSModuleNamespace
- https://crrev.com/c/1649473 - [heapprofiler] QueryObjects: do not return objects retained by feedback information
- https://crrev.com/c/1652155 - DevTools: teach page.printToPDF to return IO::Stream

References #4563
Fix #4545
aslushnikov added a commit to aslushnikov/puppeteer that referenced this issue Jun 14, 2019
This lets transferring massive PDF files over the protocol.

Fix puppeteer#4563
aslushnikov added a commit that referenced this issue Jun 15, 2019
This lets transferring massive PDF files over the protocol.

Fix #4563
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chromium Issues with Puppeteer-Chromium feature upstream
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants