(node:11476) UnhandledPromiseRejectionWarning: TimeoutError: Timed out after 30000 ms while trying to connect to Chrome! The only Chrome revision guaranteed to work is r609904 - TypeScript puppeteer
Steps to reproduce
Tell us about your environment:
- Puppeteer version: puppeteer@1.11.0
- Platform / OS version: Windows 7
- URLs (if applicable):
- Node.js version: v.8.10.0
What steps will reproduce the problem? I was just trying to run puppeteer using the basic code:
const puppeteer = require(' puppeteer');
(async () => { const browser = await puppeteer.launch(); const page = await browser.newPage();
await page.goto('https://example.com'); await page.screenshot({path: 'example.png'});
await browser.close(); })();
What is the expected result? I am expecting it to run and create a screenshot example.png just like the other tutorials.
What happens instead? But, it's giving me error: (node:11476) UnhandledPromiseRejectionWarning: TimeoutError: Timed out after 30000 ms while trying to connect to Chrome! The only Chrome revision guaranteed to work is r609904 at Timeout.onTimeout
(node:11476) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:11476) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
9 Answer:
@eduardochiletto Did you find a solution? In also happens for me in GCP
@nonyy Well, I'm useing GCP and now AWS. But I found the solution, had to run with argument --no-sandbox
Solve it by allow headless chrome like @tah said :
const browser = await puppeteer.launch({
args: ['--no-sandbox']
});
More ever, the default memory on an App Engine instance is not enough to run headless chrome, you just have to add to your app.yaml for have an instance with more memory :
instance_class: F4
INSTANCE CLASSES :
Instance Class | Memory Limit | CPU Limit | Supported Scaling Types |
---|---|---|---|
F1 (default) | 128 MB | 600 MHz | automatic |
F2 | 256 MB | 1.2 GHz | automatic |
F4 | 512 MB | 2.4 GHz | automatic |
F4_1G | 1024 MB | 2.4 GHz | automatic |
B1 | 128 MB | 600 MHz | manual, basic |
B2 (default) | 256 MB | 1.2 GHz | manual, basic |
B4 | 512 MB | 2.4 GHz | manual, basic |
B4_1G | 1024 MB | 2.4 GHz | manual, basic |
B8 | 1024 MB | 4.8 GHz | manual, basic |
To understand more about it : https://cloud.google.com/appengine/docs/standard/nodejs/using-headless-chrome-with-puppeteer
@itsalc01 windows launching troubles were largely related to the chrome policy; can yuo please try this workdaround?
I am also facing this trouble. I am using pptr in Docker, host machine is centos7.
Version : "puppeteer": "^1.14.0" Error information :
{ TimeoutError: Timed out after 30000 ms while trying to connect to Chrome! The only Chrome revision guaranteed to work is r641577 at Timeout.onTimeout (/home/node/node_modules/puppeteer/lib/Launcher.js:353:14) at ontimeout (timers.js:436:11) at tryOnTimeout (timers.js:300:5) at listOnTimeout (timers.js:263:5) at Timer.processTimers (timers.js:223:10) name: 'TimeoutError' }
Since the original author was running on Windows and seemed to disappear - closing this.
@AJLoveChina for unix issues, please check out our troubleshooting: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md
author disappearing, doesn't fix the issue.. Having the same. When lunching from win 10 only the "revision guaranteed to work" number is r672088
using puppeteer v1.18.1
@SashaDesigN did you ever find a solution to this? I'm having this error running a Docker container deployed in Centos. It only happens when the HTML arg to .setContent is very large (but still < 200 MB) Allocated operating memory is 2GB, but I haven't checked how big the puppeteer object is getting.
me daba el mismo error soluciono agregando read_timeout y cambiar el tiempo
puppeteer.launch({read_timeout: 30000});
Read next
- Changelog and releases - C fwupd
- Element hangs on launch on Fedora 33 - TypeScript element-web
- Jetpack search page from WP.com indicates a WP.com site, even when self-hosted - wp-calypso
- Connect component not exported (aws-amplify-vue) - amplify-js
- olive [CRASH] Moved position of Sequence Viewer - Cplusplus
- process.send() blocked indefinitely if buffer is full - Python pwntools
- vscode Cannot right-click copy text from markdown preview window TypeScript
- Splat doesn't work for array - yq