chrome-launcher icon indicating copy to clipboard operation
chrome-launcher copied to clipboard

Fail to Launch Chrome for Lighthouse Testing on Jenkins running on RHLS 7.4

Open 29rayb opened this issue 6 years ago • 3 comments

Getting the following error: ChromeLauncher:error connect ECONNREFUSED 127.0.0.1:38657 +0ms ChromeLauncher:error Logging contents of /tmp/lighthouse.B2HOcLX/chrome-err.log +1ms ChromeLauncher:error [0605/154657.412774:ERROR:zygote_host_impl_linux.cc(88)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180. ChromeLauncher:error +0ms Unable to connect to Chrome

when running: lighthouse --chrome-flags="--headless" --no-sandbox https://www.google.com/

At times, I get this output: which: no chromium in (/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/linux/.local/bin:/home/linux/bin) although I have chromium-browser downloaded, which is the third element in the priorities array in /chrome-launcher/dist/...

Here are the versions downloaded: 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 Red Hat Enterprise Linux Server release 7.4 (Maipo)

Here is the script run on Jenkins: "node_modules/lighthouse/lighthouse-cli/index.js --output-path=./lighthouse-report.html --quiet --chrome-flags='--headless' APP_URL" that causes this error in Jenkins: Unable to connect to Chrome 15:20:44 error Command failed with exit code 1.

Any help would be deeply appreciated.

UPDATE 1: Adding chrome-flags like '--disable-gpu' and '--no-sandbox' does not change the output. When running the script directly on the virtual machine, the output: [0605/165605.343911:ERROR:gpu_process_transport_factory.cc(1019)] Lost UI shared context. DevTools listening on ws://127.0.0.1:9222/devtools/browser/ee01e47b-606e-4a29-827b-df51c5f033eb Fontconfig warning: "/etc/fonts/fonts.conf", line 146: blank doesn't take any effect anymore. please remove it from your fonts.conf [0605/165606.059188: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/165606.061377:ERROR:viz_main_impl.cc(197)] Exiting GPU process due to errors during initialization [0605/165606.062473:ERROR:service_manager_context.cc(252)] Attempting to run unsupported native service: /usr/lib64/chromium-browser/content_gpu.service [0605/165606.610839: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/165606.613197:ERROR:viz_main_impl.cc(197)] Exiting GPU process due to errors during initialization [0605/165607.182049: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/165607.183908:ERROR:viz_main_impl.cc(197)] Exiting GPU process due to errors during initialization [0605/165607.828796: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/165607.830836:ERROR:viz_main_impl.cc(197)] Exiting GPU process due to errors during initialization [0605/165607.831810:ERROR:service_manager_context.cc(252)] Attempting to run unsupported native service: /usr/lib64/chromium-browser/content_gpu.service

I have looked everywhere on the web, but cant seem to find a solution to this...

29rayb avatar Jun 05 '18 22:06 29rayb

Do we have any update on this? Any work-around? @ray-kim-12

Nikunj1703 avatar May 01 '19 20:05 Nikunj1703

@ray-kim-12 You will need to pass both headless and no-sandbox together as chrome-flgas. Try doing -

lighthouse --chrome-flags="--headless --no-sandbox" https://www.google.com/

tk26 avatar May 01 '19 21:05 tk26

Really Interested in update on this. Working on the same lines here. @tk26 it won't work in that way too.

DinakarC-practise avatar Dec 12 '19 19:12 DinakarC-practise