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

environment variable CHROME_PATH must be set to executable of a build of Chromium #5424

Closed
sillpa-polasani opened this issue Jun 4, 2018 · 15 comments

Comments

@sillpa-polasani
Copy link

Jenkins-lighthouse setup instructions:
https://kitconcept.com/blog/continuous-performance-analysis-with-lighthouse-and-jenkins/

Issue:
I am trying to setup lighthouse on jenkins machine.
I am getting following error:

Runtime error encountered: The environment variable CHROME_PATH must be set to executable of a build of Chromium version 54.0 or later.
Error: The environment variable CHROME_PATH must be set to executable of a build of Chromium version 54.0 or later.
at Object.linux (/xxxxx/node_modules/chrome-launcher/dist/chrome-finder.js:108:15)

Environment Information

  • Affected Channels:
  • Lighthouse version: 2.9.4
  • Node.js version: v6.10.0
  • Operating System: linux
@patrickhulce
Copy link
Collaborator

They seem to have left out the step where you install Chrome :)

Take a look at https://github.com/GoogleChrome/lighthouse/blob/master/docs/headless-chrome.md#running-lighthouse-using-headless-chrome

@29rayb
Copy link

29rayb commented Jun 4, 2018

Hi, I am getting the following error when trying to yum install chromium-browser

Error: Package: chromium-browser-38.0.2125.111-1.el6.centos.x86_64 (chromium-el6) Requires: libudev.so.0()(64bit)

and when I try to install it with yum install chromium-browser --skip-broken, I get the following:
Packages skipped because of dependency problems: chromium-browser-38.0.2125.111-1.el6.centos.x86_64 from chromium-el6

typing rpm -Va --nofiles --nodigest, produces no output, but the chromium-browser is not downloaded.

Red Hat Enterprise Linux 7.4

@patrickhulce
Copy link
Collaborator

Troubleshooting RHEL issues for Chrome installs is a bit beyond the scope of these issues :)

you might be interested in puppeteer/puppeteer#765 though, which seems similar?

@29rayb
Copy link

29rayb commented Jun 5, 2018

Typing which chromium-browser outputs: Chromium 65.0.3325.181 Fedora Project
but still can't run lighthouse in my Jenkins as it fails with: Unable to connect to Chrome \n error Command failed with exit code 1. .
More specifically, the Jenkins fails during this script node_modules/lighthouse/lighthouse-cli/index.js --output-path=./lighthouse-report.html --quiet --chrome-flags='--headless' APP_URL

@patrickhulce
Copy link
Collaborator

Are you able to start Chrome normally with a debugging port? Getting Chrome working normally on your machine is a prerequisite of using Lighthouse.

i.e. does chromium-browser --remote-debugging-port=9222 work? and if so, can you connect to it yourself without lighthouse?

@29rayb
Copy link

29rayb commented Jun 5, 2018

I am running this on a VM running Red Hat Linux Server 7.4.
Running chromium-browser --remote-debugging-port=9222 outputs (chromium-browser:15573): Gtk-WARNING **: cannot open display:

Here are the versions:
google-chrome-stable --version: Google Chrome 67.0.3396.62
chromium-browser --version: Chromium 65.0.3325.181 Fedora Project
chromedriver --version: ChromeDriver 2.39.562737 (dba483cee6a5f15e2e2d73df16968ab10b38a2bf)
lighthouse --version: 2.9.4

@patrickhulce
Copy link
Collaborator

If you're doing headless you'll need to add --headless, otherwise follow the aforementioned link for setting up xvfb

@29rayb
Copy link

29rayb commented Jun 5, 2018

Running: chromium-browser --remote-debugging-port=9222 --headless outputs:

`[0605/124351.856035:ERROR:gpu_process_transport_factory.cc(1019)] Lost UI shared context.

DevTools listening on ws://127.0.0.1:9222/devtools/browser/2a69d624-323e-4aca-aebd-a079ada7a712
Fontconfig warning: "/etc/fonts/fonts.conf", line 146: blank doesn't take any effect anymore. please remove it from your fonts.conf
[0605/124352.885142:ERROR:gl_implementation.cc(292)] Failed to load /usr/lib64/chromium-browser/swiftshader/libGLESv2.so: /usr/lib64/chromium-browser/swiftshader/libGLESv2.so: cannot open shared object file: No such file or directory
[0605/124352.888009:ERROR:viz_main_impl.cc(197)] Exiting GPU process due to errors during initialization
[0605/124353.414645:ERROR:gl_implementation.cc(292)] Failed to load /usr/lib64/chromium-browser/swiftshader/libGLESv2.so: /usr/lib64/chromium-browser/swiftshader/libGLESv2.so: cannot open shared object file: No such file or directory
[0605/124353.417383:ERROR:viz_main_impl.cc(197)] Exiting GPU process due to errors during initialization
[0605/124353.995674:ERROR:gl_implementation.cc(292)] Failed to load /usr/lib64/chromium-browser/swiftshader/libGLESv2.so: /usr/lib64/chromium-browser/swiftshader/libGLESv2.so: cannot open shared object file: No such file or directory
[0605/124353.998605:ERROR:viz_main_impl.cc(197)] Exiting GPU process due to errors during initialization
[0605/124354.601323:ERROR:gl_implementation.cc(292)] Failed to load /usr/lib64/chromium-browser/swiftshader/libGLESv2.so: /usr/lib64/chromium-browser/swiftshader/libGLESv2.so: cannot open shared object file: No such file or directory
[0605/124354.604222:ERROR:viz_main_impl.cc(197)] Exiting GPU process due to errors during initialization
[0605/124354.604967:ERROR:service_manager_context.cc(252)] Attempting to run unsupported native service: /usr/lib64/chromium-browser/content_gpu.service`

@patrickhulce
Copy link
Collaborator

Then yes, it looks like Chromium is having trouble starting on your machine. Once you get Chromium working @ray-kim-12, you're able to connect to it yourself w/o Lighthouse, and you're still having trouble starting Lighthouse, please open a new issue that documents the specific bug.

Right now, it looks like it's complaining about GPU so try --disable-gpu, future generic Chromium output troubleshooting might be better received on StackOverflow.

@sunshineperi
Copy link

@ray-kim-12 hi, I'm getting the same error, have you managed to start chromium successfully?

@carcinocron
Copy link

carcinocron commented Aug 21, 2019

They seem to have left out the step where you install Chrome :)

Take a look at https://github.com/GoogleChrome/lighthouse/blob/master/docs/headless-chrome.md#running-lighthouse-using-headless-chrome

This says to run apt-get install chromium but chromium is not an installable option, but when considering what is actually available, it's not clear if I'm installing chromium-driver or chromium-browser (to a headless VPS/lambda).

@patrickhulce
Copy link
Collaborator

@InstanceOfMichael it depends on your specific flavor of linux what it's called, but chromium-driver is almost certainly not it. chromium and chromium-browser are most common and recommended for a stable version but if no package is available you can always download directly from tip-of-tree builds https://download-chromium.appspot.com/.

@carcinocron
Copy link

This ended up working for me:

CHROME_PATH=/usr/bin/chromium-browser npx lighthouse-badges --urls https://myapp.com -o badges

@4NUR46
Copy link

4NUR46 commented Feb 2, 2021

Download Chrome Browser First
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

Install the Chrome Browser then
sudo apt install ./google-chrome-stable_current_amd64.deb

Then maybe that issue will not occure.

Its Works for me.

@sfq1110660201
Copy link

Jenkins-lighthouse setup instructions: https://kitconcept.com/blog/continuous-performance-analysis-with-lighthouse-and-jenkins/

Issue: I am trying to setup lighthouse on jenkins machine. I am getting following error:

Runtime error encountered: The environment variable CHROME_PATH must be set to executable of a build of Chromium version 54.0 or later. Error: The environment variable CHROME_PATH must be set to executable of a build of Chromium version 54.0 or later. at Object.linux (/xxxxx/node_modules/chrome-launcher/dist/chrome-finder.js:108:15)

Environment Information

  • Affected Channels:
  • Lighthouse version: 2.9.4
  • Node.js version: v6.10.0
  • Operating System: linux

这个问题是由于服务器没有安装chrome导致的,linux redhat安装离线chrome:
yum -y install google-chrome-stable_current_x86_64.rpm

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

7 participants