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

Error on ubuntu 20.04

Open Djiit opened this issue 2 years ago • 4 comments

Hey team, we're using this action on self-hosted runners using an image derived from ubuntu 20.04 and got this error:

Run browser-actions/setup-chrome@latest
  with:
    chrome-version: latest
Setup chromium latest
Attempting to download latest...
(...)
Successfully Installed chromium to /opt/hostedtoolcache/chromium/latest/x64
Successfully installed chromium to /opt/hostedtoolcache/chromium/latest/x64/chrome
Successfully setup chromium version latest
/opt/hostedtoolcache/chromium/latest/x64/chrome --version
/opt/hostedtoolcache/chromium/latest/x64/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
Error: The process '/opt/hostedtoolcache/chromium/latest/x64/chrome' failed with exit code 127

Did I miss a dependency ?

Thanks

Djiit avatar Jun 08 '22 16:06 Djiit

Same here! Running in self hosted image

oeduardoal avatar Jun 13 '22 21:06 oeduardoal

Got around this with the following workaround on my self hosted runner (grabbed the list from here https://stackoverflow.com/questions/58134793/error-while-loading-shared-libraries-libnss3-so-while-running-gtlab-ci-job-to):

    - run: |
        sudo apt-get update
        sudo apt-get install -y libgconf-2-4 libatk1.0-0 libatk-bridge2.0-0 libgdk-pixbuf2.0-0 libgtk-3-0 libgbm-dev libnss3-dev libxss-dev libasound2
    - uses: browser-actions/setup-chrome@latest

Before:

image

After:

image

admosity avatar Jul 06 '22 13:07 admosity

This is also an issue when using ACT, it uses docker runner based in ubuntu that doesn't have those libraries, I think this action should take care of missing libraries.

manolo avatar Oct 06 '22 07:10 manolo

I have the same issue on self hosted runner based on ubuntu 20.04, thank you for the workaround!

Did anyone already try this on ubuntu 22.04 runners?

alexef avatar Jun 13 '23 07:06 alexef

The setup-chrome v1.6.0 now supports a new parameter install-dependencies. It will install required packages automatically in Linux. You can enable this feature like this:

- uses: browser-actions/setup-chrome@v1
  with:
    chrome-version: 120
    install-dependencies: true

Thank you for your reporting, and I'm closing this issue.

ueokande avatar May 03 '24 14:05 ueokande

Hi @ueokande, thanks for delivery of install-dependencies feature. However, we are still getting Permission denied when apt-get update and this is caused by missing sudo options.

image

https://github.com/browser-actions/setup-chrome/pull/521/files#r1597971043

lucetre avatar May 13 '24 07:05 lucetre