(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.

Asked Oct 12 '21 20:10
avatar itsalc01
itsalc01

9 Answer:

@eduardochiletto Did you find a solution? In also happens for me in GCP

1
Answered Jan 24 '19 at 14:15
avatar  of tah
tah

@nonyy Well, I'm useing GCP and now AWS. But I found the solution, had to run with argument --no-sandbox

1
Answered Jan 28 '19 at 13:01
avatar  of tah
tah

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

1
Answered Mar 25 '19 at 13:22
avatar  of hichemamb
hichemamb

@itsalc01 windows launching troubles were largely related to the chrome policy; can yuo please try this workdaround?

1
Answered Apr 21 '19 at 06:50
avatar  of aslushnikov
aslushnikov

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' }

1
Answered May 29 '19 at 01:06
avatar  of AJLoveChina
AJLoveChina

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

1
Answered Jun 02 '19 at 20:29
avatar  of aslushnikov
aslushnikov

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

1
Answered Jul 02 '19 at 19:10
avatar  of verybluebot
verybluebot

@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.

1
Answered Dec 09 '20 at 02:33
avatar  of yeti-detective
yeti-detective

me daba el mismo error soluciono agregando read_timeout y cambiar el tiempo

puppeteer.launch({read_timeout: 30000});

1
Answered Jan 13 '21 at 17:51
avatar  of antoni-24
antoni-24