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

Win10 x64 always throws timeout #3186

Closed
dnl1 opened this issue Sep 4, 2018 · 15 comments
Closed

Win10 x64 always throws timeout #3186

dnl1 opened this issue Sep 4, 2018 · 15 comments
Labels
chromium Issues with Puppeteer-Chromium

Comments

@dnl1
Copy link

dnl1 commented Sep 4, 2018

Hey guys, i'm stucked into a problem.

const browser = await puppeteer.launch({ headless: false });

Chromium open but, always throws timeout exception:

TimeoutError: Timed out after 120000 ms while trying to connect to Chrome! The only Chrome revision guaranteed to work is r579032 at Timeout.onTimeout (C:\git\view-render\node_modules\puppeteer\lib\Launcher.js:310:14) at ontimeout (timers.js:482:11) at tryOnTimeout (timers.js:317:5) at Timer.listOnTimeout (timers.js:277:5)

@dnl1 dnl1 changed the title Win10 X64 always throws timeout Win10 x64 always throws timeout Sep 4, 2018
@piampri
Copy link

piampri commented Sep 24, 2018

Is this problem gonna be addressed ? It is on-going it appears

@aslushnikov
Copy link
Contributor

@dnl1 @piampri what's you pptr version? Can you paste the whole script you try to run? Is there any firewall/antivirus software that might prevent connecting to chromium's web socket?

@mu-yu
Copy link

mu-yu commented Oct 18, 2018

Got the same error. Chromium is launched with blank page, and nothing happened until timeout error emitted after 30 seconds.And then, chromium will be auto closed.

node version: v10.11.0
pptr version: 1.8.0 / 1.9.0
win10 version: 1803 / 17134.167

demo script:

(async () => {
  try {
    const browser = await puppeteer.launch()
    const page = await browser.newPage()
    await page.goto('https://www.google.com')

    await browser.close()
  } catch (e) {
    console.log(e)
  }
})()

error message:

{ TimeoutError: Timed out after 30000 ms while trying to connect to Chrome! The only Chrome revision guaranteed to work is r588429
    at Timeout.onTimeout (D:\code\path\to\projAddr\node_modules\puppeteer\lib\Launcher.js:344:14)
    at ontimeout (timers.js:425:11)
    at tryOnTimeout (timers.js:289:5)
    at listOnTimeout (timers.js:252:5)
    at Timer.processTimers (timers.js:212:10) name: 'TimeoutError' }

@shulamyt
Copy link

shulamyt commented Nov 7, 2018

I have same problem..

@noamshay
Copy link

noamshay commented Nov 8, 2018

please fix this issue.. it's a pain for me as well

@mu-yu
Copy link

mu-yu commented Nov 9, 2018

I have debug the launcher.js today, found that timeout was happened on waitForWSEndpoint,

 const rl = readline.createInterface({ input: chromeProcess.stderr });
    let stderr = '';
    const listeners = [
      helper.addEventListener(rl, 'line', onLine),
      helper.addEventListener(rl, 'close', () => onClose()),
      helper.addEventListener(chromeProcess, 'exit', () => onClose()),
      helper.addEventListener(chromeProcess, 'error', error => onClose(error))
    ];
    const timeoutId = timeout ? setTimeout(onTimeout, timeout) : 0; // timeout here for onLine never called

Could you please deep check here why onLine is never called. @aslushnikov

edit:
seems that in the readline.js input(chromeProcess.stderr) doesn't emit end correct

chromeProcess.connected is false after spawn. Here is some doc from nodejs.org.

The subprocess.connected property indicates whether it is still possible to send and receive messages from a child process. When subprocess.connected is false, it is no longer possible to send or receive messages.

@mattanbi
Copy link

mattanbi commented Nov 9, 2018

+1 blocker for us as well

@adihemi
Copy link

adihemi commented Nov 15, 2018

+1 I'm also facing the same problem

@vovkind
Copy link

vovkind commented Dec 5, 2018

+1

@svorach
Copy link

svorach commented Mar 4, 2019

+1

@mu-yu
Copy link

mu-yu commented Mar 18, 2019

I found this issue today #3681 ,and it fixed the timeout issue.

here is my test code which works fine. I dont't know why but it just work.:

const puppeteer = require('puppeteer')

;(async () => {
  try {
    const browser = await puppeteer.launch({
      ignoreDefaultArgs: ['--disable-extensions'], // this line makes pptr work
    })
    const page = await browser.newPage()
    await page.goto('https://www.baidu.com')
    await page.screenshot({ path: 'baidu.png' })

    await browser.close()
  } catch (e) {
    console.log(e.message)
  }

@mu-yu
Copy link

mu-yu commented Mar 18, 2019

I found several similar issues for timeout on win10x64, maybe it should be written in /docs/troubleshooting.md

@ThomasMcGarry101
Copy link

Has this issue been resolved in the latest release? The same issue is still permitting for me. Thanks

@aslushnikov
Copy link
Contributor

@ThomasMcGarry101 check out our windows troubleshooting.

@sparker-sagrad
Copy link

I have the same issue on Windows 10.

Adding ignoreDefaultArgs: ['--disable-extensions'], from the link above does not solve the issue.

Node v10.16.3
Puppeteer v6.4.0

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

No branches or pull requests