puppeteer: What is "Page crashed!" error?
Steps to reproduce
N/A (Not able to reproduce consistently.)
Tell us about your environment:
- Puppeteer version: master
- Platform / OS version: Docker image based on Node:8.5 https://gist.github.com/gajus/3426d738dde10ce3c9a9bb39138578ea
- URLs (if applicable): https://www.myvue.com/
What steps will reproduce the problem?
Please include code that reproduces the issue.
const defaultPuppeteerOptions: Object = {
args: [
'--no-sandbox',
'--disable-setuid-sandbox'
],
devtools: false,
headless: true,
ignoreHTTPSErrors: true,
slowMo: 0
};
const defaultViewport = {
deviceScaleFactor: 1,
hasTouch: false,
height: 1024,
isLandscape: false,
isMobile: false,
width: 1280
};
const browser = await puppeteer.launch({
...defaultPuppeteerOptions
});
const page = await browser.newPage();
await page.setViewport(defaultViewport);
await page.goto('https://www.myvue.com/');
What is the expected result?
No error.
What happens instead?
unhandledRejection Error: Page crashed!
at Page._onTargetCrashed (/srv/node_modules/puppeteer-edge/lib/Page.js:102:24)
at Session.Page.client.on.event (/srv/node_modules/puppeteer-edge/lib/Page.js:97:56)
at emitOne (events.js:115:13)
at Session.emit (events.js:210:7)
at Session._onMessage (/srv/node_modules/puppeteer-edge/lib/Connection.js:210:12)
at Connection._onMessage (/srv/node_modules/puppeteer-edge/lib/Connection.js:105:19)
at emitOne (events.js:115:13)
at WebSocket.emit (events.js:210:7)
at Receiver._receiver.onmessage (/srv/node_modules/ws/lib/WebSocket.js:143:47)
at Receiver.dataMessage (/srv/node_modules/ws/lib/Receiver.js:389:14)
at Receiver.getData (/srv/node_modules/ws/lib/Receiver.js:330:12)
at Receiver.startLoop (/srv/node_modules/ws/lib/Receiver.js:165:16)
at Receiver.add (/srv/node_modules/ws/lib/Receiver.js:139:10)
at Socket._ultron.on (/srv/node_modules/ws/lib/WebSocket.js:139:22)
at emitOne (events.js:115:13)
at Socket.emit (events.js:210:7)
at addChunk (_stream_readable.js:266:12)
at readableAddChunk (_stream_readable.js:253:11)
at Socket.Readable.push (_stream_readable.js:211:10)
at TCP.onread (net.js:585:20)
I am intermittently getting “Page crashed!” error.
What does the error mean?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 7
- Comments: 29 (2 by maintainers)
Commits related to this issue
- Updaating the source URL - s/bukan-haien/corona/ Also, we've got an error: `UnhandledPromiseRejectionWarning: Error: Page crashed!` Resolved with this: - https://github.com/puppeteer/puppeteer/issu... — committed to wataruoguchi/covid19_nagano_scraper by wataruoguchi 4 years ago
- Fixed a page crashed error Added '--disable-dev-shm-usage', '--disable-gpu' into the puppeteer launch in order to fix a "(node:117132) UnhandledPromiseRejectionWarning: Error: Page crashed!" error I... — committed to possibly-not/gitbook-printer by possibly-not 4 years ago
- Try avoiding shm https://github.com/puppeteer/puppeteer/issues/1321#issuecomment-378361236 — committed to captbaritone/webamp by captbaritone 3 years ago
- Fix locally crashing unit tests Inspired by https://github.com/puppeteer/puppeteer/issues/1321 where no-sandbox option was being used - not sure why it works though — committed to vacuumlabs/adalite by refi93 2 years ago
- Fix locally crashing unit tests Inspired by https://github.com/puppeteer/puppeteer/issues/1321 where no-sandbox option was being used - not sure why it works though — committed to vacuumlabs/adalite by refi93 2 years ago
- Fix locally crashing unit tests Inspired by https://github.com/puppeteer/puppeteer/issues/1321 where no-sandbox option was being used - not sure why it works though — committed to vacuumlabs/adalite by refi93 2 years ago
This worked
Copied from https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#tips
I still had this
Error: Page crashed with '--disable-dev-shm-usage'on Ubuntu 16.04 even withconst browser = await puppeteer.launch({ args: ['--no-sandbox', '--disable-dev-shm-usage'] });That answer did not explain what the error means.
For anyone running into this issue on K8S, the issue is that
/dev/shmallocation is too small (64MB default).You cannot override Docker shm configuration in K8S, however, there is this workaround https://stackoverflow.com/a/46434614/368691.
I solve my issue already. The problem was that there wasn’t enough memory in my VM so it kept giving me this error. Kill all unnecessary processes and running puppeteer one more time did the trick.
I met this on Ubuntu 16.04 (no docker)
I faced the same problem for getting full html content on k8s. I tried
--disable-dev-shm-usageparameter but it did not work. I fixed the problem using--disable-gpuparameter.Getting this error on windows 10 (no docker). Just created a basic app,
Nodev10.16.2
Get the following error,
Yes, it might be an issue with the latest version. We recently switched to 3.3.0 version and started getting this issue. We reverted back to 2.1.1 our older version and its working without any issue.
Crushing on Windows even before any code with empty test file.
It launches 2 Chrome “Aw, snap!” tabs. In console:
(node:23788) UnhandledPromiseRejectionWarning: Error: Page crashed!Headless: true works fine though.
have the same issue, the question here is why is an unhandled promise rejection? How can I catch that error? because looks that normal try catch not working
There’s an example Docker setup and tips and tricks when hitting issues like this in https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-in-docker.
Following the doc (https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-in-docker) I thought we do not need to provide shm_size: ‘2gb’ as this was handled by using:
const browser = await puppeteer.launch({ args: ['--disable-dev-shm-usage'] });I feel like this this change has somehow been broken.
I was seeing this in docker, the problem went away when i updated my
docker-compose.yamlto includeshm_sizei set my shm_size to 2GB.e.g.
There might be a chance if your machine is running out of space. I’ve faced a similar issue, while my system was running out of space. Once I cleared the issue, it seems to be working fine.
Getting same issues with v3. All been good on v2 with same code.
On docker following the troubleshoot and using the local executable did solve the problem for me. Not using the local executable throws “Page Crashed!”