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

LightHouse - Chrome Launching Issue #1799

Closed
rsudarson opened this issue Mar 1, 2017 · 11 comments
Closed

LightHouse - Chrome Launching Issue #1799

rsudarson opened this issue Mar 1, 2017 · 11 comments

Comments

@rsudarson
Copy link

rsudarson commented Mar 1, 2017

When I run lighthouse I stuck at the below error in launching chrome browser,

Chrome: 56.0.2924.87 (64-bit)
LIGHTHOUSE_CHROMIUM_PATH = /usr/bin/google-chrome-stable

Lighthouse Cli invocation
./lighthouse http://abcd.test.com/ --verbose
Lighthouse CLI:verbose Using supplied port 9222 +0ms
Lighthouse CLI Launching Chrome... +8ms
ChromeLauncher:verbose created /tmp/lighthouse.rmRno9z +7ms
ChromeLauncher:verbose Chrome running with pid 24444 on port 9222. +25ms
ChromeLauncher Waiting for browser. +0ms
ChromeLauncher Waiting for browser... +1ms
ChromeLauncher Waiting for browser..... +504ms
ChromeLauncher Waiting for browser....... +501ms
ChromeLauncher Waiting for browser......... +502ms
ChromeLauncher Waiting for browser........... +501ms
ChromeLauncher Waiting for browser............. +501ms
ChromeLauncher Waiting for browser............... +502ms
ChromeLauncher Waiting for browser................. +501ms
ChromeLauncher Waiting for browser................... +501ms
ChromeLauncher Waiting for browser..................... +502ms
ChromeLauncher Waiting for browser....................... +501ms
(node:24423) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'kill' of undefined

Chrome Error Log:
[24444:24444:0301/185543.506507:FATAL:zygote_host_impl_linux.cc(107)] No usable sandbox! Update your kernel or see https://chromium.googlesource.com/chromium/src/+/master/docs/linux_suid_sandbox_development.md for more information on developing with the SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox.

I passed --no-sandbox in chrome-launcher.js and it re-run the lighthouse command and it worked fine.

Changes to chrome-launcher.js
const flags = [
--remote-debugging-port=${this.port},
'--no-sandbox', //added no sandbox option
]

How to provide this flag as an option from lighthouse cli? or How to overcome the issue mentioned above.

@patrickhulce
Copy link
Collaborator

Which OS and version are you running?

It looks like Chrome is complaining about the version of your linux kernel. There's a new lighthouse option that's been added to use arbitrary Chrome flags (#1761) that you could use, but I recommend against using --no-sandbox and suggest updating to a supported version of Linux instead.

@paulirish
Copy link
Member

A workaround for the moment is running chrome-debug --no-sandbox to kick off your chrome with all the correct flags..

Then run lighthouse http://abcd.test.com/ --verbose separately.

@rsudarson
Copy link
Author

rsudarson commented Mar 2, 2017

First of all thanks patrickhulce and paulirish for the quick reply.

I'm using Red Hat Enterprise Linux Server release 7.3 (Maipo)

Kernal : 3.10.0-514.6.1.el7.x86_64
Google Chrome 56.0.2924.87

Command:
/usr/bin/google-chrome-stable --remote-debugging-port=9222 --no-sandbox --disable-translate --disable-extensions --disable-background-networking --safebrowsing-disable-auto-update --disable-sync --metrics-recording-only --disable-default-apps --no-first-run --user-data-dir=/tmp/lighthouse.fY3nGmF --disable-setuid-sandbox about:blank

LightHouse Invocation:
lighthouse --disable-network-throttling --disable-cpu-throttling --output html --output-path=

Results are dumped but terminal hangs and not comes out of execution.
Printer json output written to /x/x/x/x/x/report.json +9ms
ChromeLauncher Killing all Chrome Instances +0ms

Also ps -f grep "chrome" tells that [chrome]

chrome-err.log
Gkr-Message: secret service operation failed: The name org.freedesktop.secrets was not provided by any .service files
[326:326:0303/000515.527184:ERROR:sandbox_linux.cc(343)] InitializeSandbox() called with multiple threads in process gpu-process.
[32690:32713:0303/000515.529497:ERROR:browser_gpu_channel_host_factory.cc(125)] Failed to create channel.
[32690:32713:0303/000515.529540:ERROR:browser_gpu_channel_host_factory.cc(125)] Failed to create channel.
[32690:32713:0303/000515.529619:ERROR:browser_gpu_channel_host_factory.cc(125)] Failed to create channel.
[32690:32713:0303/000515.529693:ERROR:browser_gpu_channel_host_factory.cc(125)] Failed to create channel.
[32690:32713:0303/000515.529748:ERROR:browser_gpu_channel_host_factory.cc(125)] Failed to create channel.
[32690:32690:0303/000516.248099:ERROR:navigation_entry_screenshot_manager.cc(141)] Invalid entry with unique id: 11

@patrickhulce
Copy link
Collaborator

Seems like you're bumping into some generic Chrome issues with Red Hat, maybe this can help? http://superuser.com/questions/536433/what-applications-provide-org-freedesktop-secrets-service

@preethih78
Copy link

Hi

My experience
Im running a chrome browser version 57.0.XXXX.XX
The issue is lighthouse opens a new tab quickly when an existing chrome window is open. If it does not have a process already running , by the time the system tries to launch a window it times out as follows.
./lighthouse http://abcd.test.com/ --verbose
Lighthouse CLI:verbose Using supplied port 9222 +0ms
Lighthouse CLI Launching Chrome... +8ms
ChromeLauncher:verbose created /tmp/lighthouse.rmRno9z +7ms
ChromeLauncher:verbose Chrome running with pid 24444 on port 9222. +25ms
ChromeLauncher Waiting for browser. +0ms
ChromeLauncher Waiting for browser... +1ms
ChromeLauncher Waiting for browser..... +504ms
ChromeLauncher Waiting for browser....... +501ms
ChromeLauncher Waiting for browser......... +502ms

RESOLUTION - Launch a chrome window beforehand
When the windo is open type the following command prompt
"lighthouse http://google.com" it just works fine by opening it on a new tab

@ebidel
Copy link
Contributor

ebidel commented Jun 21, 2017

Is this still an issue with Lighthouse 2.1.0?

@LynxDelli
Copy link

It seems I have a similar issue with win7 and last lighthouse

@nogweii
Copy link

nogweii commented Jul 4, 2017

I have what appears to be the same issue, running Chromium 59.0.3071.115 on Arch, fully updated as of posting this. Lighthouse doesn't normally find the binary, so this is the current invocation that gets anywhere: LIGHTHOUSE_CHROMIUM_PATH=/usr/bin/chromium lighthouse --verbose https://evaryont.me

However I get the same error as pasted before:

  ChromeLauncher:error connect ECONNREFUSED 127.0.0.1:39209 +1ms
  ChromeLauncher:error Logging contents of /tmp/lighthouse.mvr8qPK/chrome-err.log +0ms
  ChromeLauncher:error [3942:3942:0704/045434.552111:FATAL:zygote_host_impl_linux.cc(107)] No usable sandbox! Update your kernel or see https://chromium.googlesource.com/chromium/src/+/master/docs/linux_suid_sandbox_development.md for more information on developing with the SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox.

So I tried finding the full list of command line flags in order to run Chromium manually. I eventually got it by spamming ps wwaux | grep chrom, (it'd be nice to output the full suite of parameters when the process fails so it's just a copy & paste).

The full command that was executed is: /usr/lib/chromium/chromium --disable-translate --disable-extensions --disable-background-networking --safebrowsing-disable-auto-update --disable-sync --metrics-recording-only --disable-default-apps --no-first-run --remote-debugging-port=36319 --user-data-dir=/tmp/lighthouse.BxfRUVP --disable-setuid-sandbox about:blank

Switching the ports to /usr/lib/chromium/chromium --disable-translate --disable-extensions --disable-background-networking --safebrowsing-disable-auto-update --disable-sync --metrics-recording-only --disable-default-apps --no-first-run --remote-debugging-port=9299 --user-data-dir=/tmp/lighthouse.BxfRUVP about:blank -- setting the debugging port to a static port rather than random, and removing --disable-setuid-sandbox -- in another terminal launched Chromium just fine. Running lighthose with --port=9299 let everything work.

Here's the chrome://sandbox report on my system:

  • SUID Sandbox Yes
  • Namespace Sandbox No
  • PID namespaces Yes
  • Network namespaces Yes
  • Seccomp-BPF sandbox Yes
  • Seccomp-BPF sandbox supports TSYNC Yes
  • Yama LSM Enforcing Yes
  • You are adequately sandboxed.

@preethih78
Copy link

@ebidel - Still lighhouse expects a chrome browser but im using the headless command to avoid this issue
lighthouse --quiet --chrome-flags="--headless"

@brendankenny
Copy link
Member

@paulirish need to move this over to https://github.com/GoogleChrome/chrome-launcher

@devtools-bot
Copy link

This issue was moved to GoogleChrome/chrome-launcher#34

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

10 participants