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

Page crashed!, net::ERR_INSUFFICIENT_RESOURCES errors #11

Closed
mifi opened this issue Apr 10, 2022 · 3 comments
Closed

Page crashed!, net::ERR_INSUFFICIENT_RESOURCES errors #11

mifi opened this issue Apr 10, 2022 · 3 comments

Comments

@mifi
Copy link
Owner

mifi commented Apr 10, 2022

When running with high concurrency (many browser instances), I'm experiencing these errors after a few seconds of running on Ubuntu:

  • fatal Page crashed! error
  • net::ERR_INSUFFICIENT_RESOURCES from <FFmpegVideo> <img> error event.

After a lot of digging I found out that it's because the system is running out of disk space. The disk space is being claimed by files that are immediately deleted by chromium (so they don't show up in du -hs) inside the /tmp folder, which has limited space. The files can be seen with lsof:

/tmp/.org.chromium.Chromium.0FNTrV
/tmp/.org.chromium.Chromium.Ra8ezE
/tmp/.org.chromium.Chromium.nQK7nC
/tmp/.org.chromium.Chromium.WQadCm
/tmp/.org.chromium.Chromium.IzapN6
/tmp/.org.chromium.Chromium.Mq2VFV
...

I've tried these options to puppeteer but none seem to affect these tmp files:

PUPPETEER_TMP_DIR
page.setCacheEnabled(false);
--disk-cache-dir
--media-cache-size=0
--disk-cache-size=0

However what turns out to work is to remove the --disable-dev-shm-usage from puppeteer/chromium! If this flag is removed, the files will instead be stored in /dev/shm which has a lot more space (usually many gigabytes on larger AWS EC2 machines). Turns out that the flag was added by default to puppeteer in puppeteer/puppeteer@18f2ecd - interesting discussion here: puppeteer/puppeteer#1834

Use ignoreDefaultArgs: ['--disable-dev-shm-usage']

See also:

@ryansch
Copy link

ryansch commented Nov 18, 2022

@mifi I was debugging the same issue in chromedriver and capybara today and this was where I finally found the answer. Thank you so much for sharing.

@sirmikolai
Copy link

@mifi thanks a lot, I had an identical issue when I tried to open new window, which redirected to another system. Then I got error that JS is disabled, but every requests in new tab returned net::ERR_INSUFFICIENT_RESOURCES, so I find solution here.

@caner-cetin
Copy link

I am using go-rod, and you literally saved my life.

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants