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

Puppeteer broken on Ubuntu 18.04 after upgrade & restart #4911

Closed
shark0der opened this issue Sep 5, 2019 · 13 comments
Closed

Puppeteer broken on Ubuntu 18.04 after upgrade & restart #4911

shark0der opened this issue Sep 5, 2019 · 13 comments

Comments

@shark0der
Copy link

shark0der commented Sep 5, 2019

The exact same setup worked a few hours ago. I've ran apt-get full-upgrade and it fails to run anymore. Not sure what exactly it is related to. Running in docker from latest.

Update: I was able to reproduce this on another Ubuntu 18.04 with the same kernel version. It worked fine with Linux kernel 4.15! This means that this might be a problem with chrome itself, not puppeteer - please confirm.

Update: Works fine with 5.0.0-25-generic but fails on 5.0.0-27-generic.

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: docker image buildkite/puppeteer:23a2e145eb22
  • Platform / OS version: Ubuntu 18.04.03, Linux 5.0.0-27-generic #28~18.04.1-Ubuntu SMP
  • Node.js version: v10.15.3 (bundled in the docker image)
const puppeteer = require('puppeteer');
puppeteer.launch({
  args: [
    '--disable-setuid-sandbox',
    '--no-sandbox',
    '--disable-dev-shm-usage',
  ],
})
  .then(async browser => {
    const page = await browser.newPage();
    await page.goto('https://example.com');
    // await page.screenshot({ path: '/app/screenshot.png' });
    // await browser.close();
  })
  .catch(e => {
    console.log(e);
  });

$ docker run -it -v $(pwd):/app -u node -w /app buildkite/puppeteer node test.js
Error: Navigation failed because browser has disconnected!
    at CDPSession.LifecycleWatcher._eventListeners.helper.addEventListener (/node_modules/puppeteer/lib/LifecycleWatcher.js:46:107)
    at CDPSession.emit (events.js:189:13)
    at CDPSession._onClosed (/node_modules/puppeteer/lib/Connection.js:215:10)
    at Connection._onClose (/node_modules/puppeteer/lib/Connection.js:138:15)
    at WebSocketTransport._ws.addEventListener.event (/node_modules/puppeteer/lib/WebSocketTransport.js:45:22)
    at WebSocket.onClose (/node_modules/ws/lib/event-target.js:124:16)
    at WebSocket.emit (events.js:189:13)
    at WebSocket.emitClose (/node_modules/ws/lib/websocket.js:191:10)
    at Socket.socketOnClose (/node_modules/ws/lib/websocket.js:850:15)
    at Socket.emit (events.js:189:13)
  -- ASYNC --
    at Frame.<anonymous> (/node_modules/puppeteer/lib/helper.js:110:27)
    at Page.goto (/node_modules/puppeteer/lib/Page.js:629:49)
    at Page.<anonymous> (/node_modules/puppeteer/lib/helper.js:111:23)
    at puppeteer.launch.then (/app/test.js:12:16)
    at process._tickCallback (internal/process/next_tick.js:68:7)

$ uname -a
Linux cascara 5.0.0-27-generic #28~18.04.1-Ubuntu SMP Thu Aug 22 03:00:32 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.3 LTS
Release:	18.04
Codename:	bionic

$ docker -v
Docker version 19.03.2, build 6a30dfc

$ docker image ls | grep puppeteer
buildkite/puppeteer   latest              23a2e145eb22        4 months ago        830MB

$ docker run -it -v $(pwd):/app -u node -w /app buildkite/puppeteer node -v     
v10.15.3

The same script (same flags) worked before the upgrade & reboot.

@tscheepers
Copy link

tscheepers commented Sep 6, 2019

I'm having the same issue on a Debian buster docker container. Using both Chrome unstable and Chrome stable. I also did reboot my host machine (Ubuntu 19.04 Linux 5.0.0-27-generic x86_64), after which this issue arose.

Running on macOS host machine there is no problem.

Could be related to #4679

@Josh-G
Copy link

Josh-G commented Sep 9, 2019

Affects me on Docker to, works on macOS host and Ubuntu w/ kernel 5.0.0-25-generic but not under 5.0.0-27-generic

@stefanriest
Copy link

same here...
Linux 45efdf43d123 5.0.0-27-generic #28-Ubuntu SMP Tue Aug 20 19:53:07 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

@stefanriest
Copy link

For some reason - no idea how - it works, i didnt make any updates.
The only thing is i installed on my Ubuntu 19.04 the Chrome browser (was a fresh system so i used Firefox instead)... and DANG it works?

  • Was it a kernel issue?
  • Was it puppeteer
  • Was it docker?

Any reply would be great!

@johanleroux
Copy link

@stefanriest did you install Firefox on the Ubuntu host alongside Chrome or inside the docker instance?

Struggling with the same issue as mentioned by @shark0der

@Josh-G
Copy link

Josh-G commented Sep 16, 2019

Could be kernel bug 1843018 as raised in moby/moby#39875?

@stefanriest
Copy link

i installed chrome on my host ubuntu 19.04 with 5.0.0-27-generic, firefox was already installed I didn't change anything in docker.

@nervehammer
Copy link

I can confirm its kernel-related bug. Updated my kernel to 5.3.1-050301, everything seems to work fine

@mikk351
Copy link

mikk351 commented Sep 24, 2019

puppeteer.launch({ args: [ '--single-process' ]}
Seems to fix the issue for me, running ubuntu 5.0.0-27-generic

@DanielRuf
Copy link

@Josh-G
Copy link

Josh-G commented Oct 25, 2019

subsequently fixed on Ubuntu 18.04 in kernel 5.0.0-31.33

@stale
Copy link

stale bot commented Jun 27, 2022

We're marking this issue as unconfirmed because it has not had recent activity and we weren't able to confirm it yet. It will be closed if no further activity occurs within the next 30 days.

@stale stale bot added the unconfirmed label Jun 27, 2022
@stale
Copy link

stale bot commented Jul 27, 2022

We are closing this issue. If the issue still persists in the latest version of Puppeteer, please reopen the issue and update the description. We will try our best to accomodate it!

@stale stale bot closed this as completed Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants