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

Google Chrome Headless fails to run under WSL #3749

Closed
rfgamaral opened this issue Jan 2, 2019 · 3 comments
Closed

Google Chrome Headless fails to run under WSL #3749

rfgamaral opened this issue Jan 2, 2019 · 3 comments

Comments

@rfgamaral
Copy link

I'm aware of a couple of issues related to similar problems but none of them have the same errors so I opted for opening a new issue as I'm not sure they are the same problem or different.

  • Microsoft Windows [Version 10.0.17134.472]

  • What you're doing and what's happening:

Ricardo@LP5J44QH2:~$ google-chrome --headless --disable-gpu --dump-dom https://www.chromestatus.com/
[0102/175654.650788:ERROR:gpu_process_transport_factory.cc(967)] Lost UI shared context.
Failed to generate minidump.Illegal instruction (core dumped)
Ricardo@LP5J44QH2:~$ [0100/000000.704099:ERROR:zygote_linux.cc(621)] Zygote could not fork: process_type renderer numfds 6 child_pid -1
[0100/000000.704825:ERROR:zygote_linux.cc(653)] write: Broken pipe (32)
^C
Ricardo@LP5J44QH2:~$ google-chrome --no-gpu --no-sandbox --disable-setuid-sandbox --headless --dump-dom http://www.chromestatus.com
[0102/175703.125280:ERROR:gpu_process_transport_factory.cc(967)] Lost UI shared context.
Failed to generate minidump.Illegal instruction (core dumped)
Ricardo@LP5J44QH2:~$ [0100/000000.203913:FATAL:zygote_linux.cc(87)] : No such process (3)
^C
Ricardo@LP5J44QH2:~$ google-chrome --no-gpu --no-sandbox --disable-setuid-sandbox --headless --dump-dom --single-process http://www.chromestatus.com
[0102/175712.758975:ERROR:browser_main_loop.cc(591)] Failed to put Xlib into threaded mode.
[0102/175712.778547:ERROR:gpu_process_transport_factory.cc(967)] Lost UI shared context.
Failed to generate minidump.Illegal instruction (core dumped)
Ricardo@LP5J44QH2:~$ [0100/000000.827415:ERROR:zygote_linux.cc(621)] Zygote could not fork: process_type renderer numfds 6 child_pid -1
[0100/000000.828156:ERROR:zygote_linux.cc(653)] write: Broken pipe (32)
^C

Similarly, this is what I get when trying to run Karma with Chrome Headless:

02 01 2019 18:02:06.653:INFO [karma]: Karma v2.0.0 server started at http://0.0.0.0:9876/
02 01 2019 18:02:06.654:INFO [launcher]: Launching browser ChromeHeadless with unlimited concurrency
02 01 2019 18:02:07.165:INFO [launcher]: Starting browser ChromeHeadless
02 01 2019 18:02:07.167:DEBUG [temp-dir]: Creating temp dir at /tmp/karma-5187846
02 01 2019 18:02:07.172:DEBUG [launcher]: google-chrome --user-data-dir=/tmp/karma-5187846 --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-background-timer-throttling --disable-renderer-backgrounding --disable-device-discovery-notifications http://localhost:9876/?id=5187846 --headless --disable-gpu --remote-debugging-port=9222
02 01 2019 18:02:11.338:DEBUG [launcher]: Process ChromeHeadless exited with code 0
02 01 2019 18:02:11.339:ERROR [launcher]: Cannot start ChromeHeadless
        [0102/180210.440718:ERROR:gpu_process_transport_factory.cc(967)] Lost UI shared context.

DevTools listening on ws://127.0.0.1:9222/devtools/browser/ba948659-afbe-483b-8915-b751e5e44905
Failed to generate minidump.[0100/000000.563390:ERROR:zygote_linux.cc(621)] Zygote could not fork: process_type renderer numfds 6 child_pid -1
[0100/000000.568799:ERROR:zygote_linux.cc(653)] write: Broken pipe (32)

02 01 2019 18:02:11.340:ERROR [launcher]: ChromeHeadless stdout:
02 01 2019 18:02:11.340:ERROR [launcher]: ChromeHeadless stderr: [0102/180210.440718:ERROR:gpu_process_transport_factory.cc(967)] Lost UI shared context.

DevTools listening on ws://127.0.0.1:9222/devtools/browser/ba948659-afbe-483b-8915-b751e5e44905
Failed to generate minidump.[0100/000000.563390:ERROR:zygote_linux.cc(621)] Zygote could not fork: process_type renderer numfds 6 child_pid -1
[0100/000000.568799:ERROR:zygote_linux.cc(653)] write: Broken pipe (32)

02 01 2019 18:02:11.342:DEBUG [temp-dir]: Cleaning temp dir /tmp/karma-5187846
  • What's wrong / what should be happening instead:

Google Chrome should launch in headless mode.

  • How have I installed Google Chrome?
curl -sS https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/google.list
sudo apt upgrade
sudo apt install google-chrome-stable
@Javiery3889
Copy link

I had the same issue, but running the command with sudo and --no-sandbox works.

$ google-chrome --enable-logging --headless -disable-gpu --screenshot http://example.com
Failed to move to new namespace: PID namespaces supported, Network namespace supported, but failed: errno = Permission denied
Failed to generate minidump.Illegal instruction (core dumped)
$ sudo google-chrome --enable-logging --headless -disable-gpu --no-sandbox --screenshot http://example.com
[0115/091032.742655:ERROR:gpu_process_transport_factory.cc(967)] Lost UI shared context.
[0115/091035.590133:INFO:headless_shell.cc(546)] Written to file screenshot.png.

@thamerla
Copy link

#3778

@benken-parasoft
Copy link

benken-parasoft commented May 16, 2019

I had the same issue, but running the command with sudo and --no-sandbox works

Also see comments about this in issue #3282

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

5 participants