CircleCI-Public / browser-tools-orb

Quickly and easily install common browsers and browser testing tools on CircleCI
https://circleci.com/developer/orbs/orb/circleci/browser-tools
MIT License
23 stars 34 forks source link

`install-chromedriver` is broken for Chrome >= 115 which is stable and latest release today #75

Closed bericp1 closed 1 year ago

bericp1 commented 1 year ago

Orb version

circleci/browser-tools@1.4.1 (latest as of writing)

What happened

chromedriver install fails:

This is because the chromedriver team migrated to a new set of JSON APIs for >=115

https://sites.google.com/chromium.org/driver/?pli=1#:~:text=Starting%20with%20M115%20the%20latest%20Chrome%20%2B%20ChromeDriver%20releases%20per%20release%20channel%20(Stable%2C%20Beta%2C%20Dev%2C%20Canary)%20are%20available%20at%20the%20Chrome%20for%20Testing%20availability%20dashboard.%20For%20automated%20version%20downloading%20one%20can%20use%20the%20convenient%20JSON%20endpoints.

Expected behavior

ChromeDriver installs

josephfrazier commented 1 year ago

I'm experiencing this as well, also on browser-tools version 1.4.1

Jaym3s commented 1 year ago

Here's a workaround for others that are hitting this:

    steps:
      - browser-tools/install-browser-tools:
          chrome-version: 114.0.5735.90 # TODO: remove -> https://github.com/CircleCI-Public/browser-tools-orb/issues/75
jonathandean commented 1 year ago

I had already tried what @Jaym3s mentioned but got this:

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 google-chrome-stable : Depends: fonts-liberation but it is not installable
                        Depends: libatk-bridge2.0-0 (>= 2.5.3) but it is not installable
                        Depends: libatk1.0-0 (>= 2.2.0) but it is not installable
                        Depends: libatspi2.0-0 (>= 2.9.90) but it is not installable
                        Depends: libcups2 (>= 1.6.0) but it is not installable
                        Depends: libgtk-3-0 (>= 3.9.10) but it is not installable or
                                 libgtk-4-1 but it is not installable
                        Depends: libnspr4 (>= 2:4.9-2~) but it is not installable
                        Depends: libnss3 (>= 2:3.31) but it is not installable
                        Depends: libu2f-udev but it is not installable
                        Depends: libvulkan1 but it is not installable
                        Depends: libxcomposite1 (>= 1:0.4.4-1) but it is not installable
                        Depends: libxdamage1 (>= 1:1.1) but it is not installable
                        Depends: xdg-utils (>= 1.0.2) but it is not installable

I also tried adding replace-existing: true and also tried deleting cache contents from the Docker Layer Caching page in project settings and still got this error.

josephfrazier commented 1 year ago

I created a CircleCI support request pointing them to this github issue and telling them that all our PRs have broken builds because of it, to try to get it escalated.

jonathandean commented 1 year ago

If anyone is curious this is the announcement of the breaking change in May: https://groups.google.com/g/chromedriver-users/c/clpipqvOGjE/m/5NxzS_SRAgAJ

jonathandean commented 1 year ago

Looks like this PR is related as it mentions this general problem: https://github.com/CircleCI-Public/browser-tools-orb/pull/72

josephfrazier commented 1 year ago

If anyone is curious this is the announcement of the breaking change in May: https://groups.google.com/g/chromedriver-users/c/clpipqvOGjE/m/5NxzS_SRAgAJ

Thanks, it looks like that should help CircleCI fix this faster

goodish452 commented 1 year ago

Workaround works well enough for our purposes. But it will definitely impact a lot of our overnight runs until teams can go through and add the workaround.

olihensel commented 1 year ago

I had the same problem as @jonathandean with the workaround. Running sudo apt-get update in a step before installing the browser fixed it for me.

gaijin1973 commented 1 year ago

@olihensel, thanks for the suggestion. I was just looking at the PR that @jonathandean posted, and it looks like this line may be the one that was intended to address the issues without your workaround: https://github.com/CircleCI-Public/browser-tools-orb/pull/72/files#diff-5432426082806dd0f398e088bb8e20badcd780a34783e189aad77f9241ace0edR127

ryanbourdais commented 1 year ago

Hi all, I'm currently working on a fix and should have one out today. This issue was caused by the endpoint we use for downloading chrome driver changing for all versions >= 115.

gaijin1973 commented 1 year ago

I had the same problem as @jonathandean with the workaround. Running sudo apt-get update in a step before installing the browser fixed it for me.

Just to reiterate / summarize the update from @olihensel to the original workaround posted by @Jaym3s, this seems to have gotten me past the browser-tools step in our workflow:

steps:
  - run: sudo apt-get update
  - browser-tools/install-chrome:
      chrome-version: "114.0.5735.90"
ryanbourdais commented 1 year ago

Just merged in the PR and cut a new patch release. Chrome driver should work for versions newer than 114 on this new version of the orb.

eveshum commented 1 year ago

I'm getting this error when bumping to 1.4.2

google-chrome --version
chromedriver --version

Google Chrome 115.0.5790.98 
/bin/bash: line 1: chromedriver: command not found

Exited with code exit status 127
CircleCI received exit code 127

Did anyone else get this?

josephfrazier commented 1 year ago

(disregard, red herring)

EDIT 2: It's because the jobs are using differently OSes with different browser versions, never mind EDIT: another job in the same workflow installed 115. Dunno why they're different, but they both install correctly, at least, which fixes the immediate problem. --- After bumping to 1.4.2, my builds are installing version 108, not 115.... ``` Installed version of Google Chrome is 108.0.5359.124 ChromeDriver 108.0.5359.71 will be installed ^@^@ChromeDriver 108.0.5359.71 (1e0e3868ee06e91ad636a874420e3ca3ae3756ac-refs/branch-heads/5359@{#1016}) has been installed to /usr/local/bin/chromedriver ```
kelvintaywl commented 1 year ago

I'm getting this error when bumping to 1.4.2

google-chrome --version
chromedriver --version

Google Chrome 115.0.5790.98 
/bin/bash: line 1: chromedriver: command not found

Exited with code exit status 127
CircleCI received exit code 127

Did anyone else get this?

Hi @eveshum

This is Kelvin from CircleCI support.

Thank you for raising this. I understand you have filed a support ticket with us at CircleCI as well.

For a workaround and an explanation of the issue seen, can you try updating your job as seen with this PR's diff: https://github.com/kelvintaywl-cci/browser-tools-142/pull/1/files

I am sharing this with our engineers in the meantime; Thank you for your patience! 🙇

MikeMcElroy commented 1 year ago

Hi @eveshum

This is Kelvin from CircleCI support.

Thank you for raising this. I understand you have filed a support ticket with us at CircleCI as well.

For a workaround and an explanation of the issue seen, can you try updating your job as seen with this PR's diff: https://github.com/kelvintaywl-cci/browser-tools-142/pull/1/files

I am sharing this with our engineers in the meantime; Thank you for your patience! 🙇

@kelvintaywl That seems to work for me :+1:

snyaggarwal commented 1 year ago

I had the same problem as @jonathandean with the workaround. Running sudo apt-get update in a step before installing the browser fixed it for me.

Just to reiterate / summarize the update from @olihensel to the original workaround posted by @Jaym3s, this seems to have gotten me past the browser-tools step in our workflow:

steps:
  - run: sudo apt-get update
  - browser-tools/install-chrome:
      chrome-version: "114.0.5735.90"

This worked for ubuntu builds but not for macos. From the documentation, "chrome-version" doesnt work in MacOS. Any workaround for macOS builds?

snyaggarwal commented 1 year ago

I'm getting this error when bumping to 1.4.2

google-chrome --version
chromedriver --version

Google Chrome 115.0.5790.98 
/bin/bash: line 1: chromedriver: command not found

Exited with code exit status 127
CircleCI received exit code 127

Did anyone else get this?

Hi @eveshum

This is Kelvin from CircleCI support.

Thank you for raising this. I understand you have filed a support ticket with us at CircleCI as well.

For a workaround and an explanation of the issue seen, can you try updating your job as seen with this PR's diff: https://github.com/kelvintaywl-cci/browser-tools-142/pull/1/files

I am sharing this with our engineers in the meantime; Thank you for your patience! 🙇

@kelvintaywl On MacOS this installs the chrome and driver but in verify step fails with: /bin/bash: google-chrome: command not found

snyaggarwal commented 1 year ago

for others using MacOS and facing the same issue, this is the way we fixed it using circleci/browser-tools@1.4.2

      - browser-tools/install-chrome
      - browser-tools/install-chromedriver
      - run:
          name: Fix PATH
          command: |
            ln -s /usr/local/bin/google-chrome-stable /usr/local/bin/google-chrome
            mv /usr/local/bin/chromedriver /usr/local/bin/chromedriver2
            ln -s /usr/local/bin/chromedriver2/chromedriver /usr/local/bin/chromedriver
            echo 'export PATH=/usr/local/bin/google-chrome:$PATH' >> $BASH_ENV
            echo 'export PATH=/usr/local/bin/chromedriver:$PATH' >> $BASH_ENV

Due to following differences on MacOS:

jonathandean commented 1 year ago

I had the same problem as @jonathandean with the workaround. Running sudo apt-get update in a step before installing the browser fixed it for me.

Just to reiterate / summarize the update from @olihensel to the original workaround posted by @Jaym3s, this seems to have gotten me past the browser-tools step in our workflow:

steps:
  - run: sudo apt-get update
  - browser-tools/install-chrome:
      chrome-version: "114.0.5735.90"

Thanks to all of you! The above workaround worked and I'll obviously try 1.4.2 next. It's nice to have green builds again :)

jonathandean commented 1 year ago

Also can confirm that circleci/browser-tools@1.4.2 worked for me on ubuntu with no need to pin a chrome version or run apt-get update.

jonathandean commented 1 year ago

Also can confirm that circleci/browser-tools@1.4.2 worked for me on ubuntu with no need to pin a chrome version or run apt-get update.

Actually I spoke too soon. The install part worked but something about the install path or other things about my setup are not quite right:

Selenium::WebDriver::Error::WebDriverError:
  chromedriver located, but: not a file: "/usr/local/bin/chromedriver"
JasonBarnabe commented 1 year ago

With 1.4.2 I get past the chromedriver install but I fail in my Rails app tests:

Unable to find latest point release version for 115.0.5790. You appear to be using a non-production version of Chrome. Please set `Webdrivers::Chromedriver.required_version = <desired driver version>` to a known chromedriver version: https://chromedriver.storage.googleapis.com/index.html

Keeping the setting chrome-version: "114.0.5735.90" per previous comments, it works.

albertski commented 1 year ago

I confirm that upgrading to 1.4.2 and adding the run to match https://github.com/kelvintaywl-cci/browser-tools-142/pull/1/files doesn't cause the ChromeDriver Error now:

      - run:
          name: Fix PATH
          command: |
            echo "see https://github.com/CircleCI-Public/browser-tools-orb/blob/de5fa4e28909039438189815dbb42ac308e49bc9/src/scripts/install-chromedriver.sh#L187"
            echo "export PATH='/usr/local/bin/chromedriver:$PATH'" >> $BASH_ENV

But now getting the following errors in my specs:

  Webdrivers::VersionError:
    Unable to find latest point release version for 115.0.5790. You appear to be using a non-production version of Chrome. Please set `Webdrivers::Chromedriver.required_version = <desired driver version>` to a known
ryanbourdais commented 1 year ago

Orb version 1.4.3 was just released which should work without the workaround from @kelvintaywl

JasonBarnabe commented 1 year ago

1.4.3 still fails in my tests unless I have chrome-version: "114.0.5735.90":

Unable to find latest point release version for 115.0.5790. You appear to be using a non-production version of Chrome. Please set `Webdrivers::Chromedriver.required_version = <desired driver version>` to a known chromedriver version: https://chromedriver.storage.googleapis.com/index.html
MikeMcElroy commented 1 year ago

For my part, 1.4.3 worked for me after I removed all the workarounds. :+1:

ryanbourdais commented 1 year ago

1.4.3 still fails in my tests unless I have chrome-version: "114.0.5735.90":

Unable to find latest point release version for 115.0.5790. You appear to be using a non-production version of Chrome. Please set `Webdrivers::Chromedriver.required_version = <desired driver version>` to a known chromedriver version: https://chromedriver.storage.googleapis.com/index.html

@JasonBarnabe it seems that you're missing the last part of the version string as stable is 115.0.5790.98 but it seems you only passed 115.0.5790.98. What image are you using, and can you give an example config?

JasonBarnabe commented 1 year ago

https://app.circleci.com/pipelines/github/Simplero/Simplero/53516/workflows/c2f2c374-4096-4676-9d68-35d15ebb6074/jobs/63338/tests shows the failure - I imagine you can view the config with that info?

ryanbourdais commented 1 year ago

Hi @JasonBarnabe it seems that your tests are checking valid chromedriver versions using the old api. If you click the link in the error message it sends you to the old api endpoint. It seems to me that the orb is now working as intended in your builds and that submitting a support request is the best way to continue.

JasonBarnabe commented 1 year ago

I believe that the issue I reported is with the webdrivers gem - caused by the same underlying change to the ChromeDriver release process, but not specifically related to Circle. As mentioned previously, adding chrome-version: "114.0.5735.90" fixes it.

albertski commented 1 year ago

After updating to 1.4.3, I'm still having the following errors during my system spec runs (no issues with the workaround):

  # --- Caused by: ---
  # Webdrivers::NetworkError:
  #   Net::HTTPServerException: 404 "Not Found" with https://chromedriver.storage.googleapis.com/LATEST_RELEASE_115.0.5790
  #   /home/circleci/project/vendor/bundle/ruby/3.0.0/gems/webdrivers-5.2.0/lib/webdrivers/network.rb:19:in `get'

config.yml

  browser-tools: circleci/browser-tools@1.4.3
...
...

    steps:
      - checkout
      - browser-tools/install-chrome
      - browser-tools/install-chromedriver
      - run:
          command: |
            google-chrome --version
            chromedriver --version
bechin92 commented 1 year ago

I'm sorry. I have a question. Please tel me when will chrome 115 be released on https://chromedriver.chromium.org/downloads

MikeMcC399 commented 1 year ago

@bechin92

I'm sorry. I have a question. Please tel me when will chrome 115 be released on https://chromedriver.chromium.org/downloads

https://chromedriver.chromium.org/downloads links to https://googlechromelabs.github.io/chrome-for-testing/ where 115 is listed under the Stable Channel. In other words it has already been released.

neliojrr commented 1 year ago

Updating to 1.4.3 worked for me. Thanks!!

snyaggarwal commented 1 year ago

on MacOS it has started throwing 404 while installing chromedriver 115.0.5790.114, using 1.4.3.

System detected as MacOS Installed version of Google Chrome is 115.0.5790.114 115.0.5790.114 will be installed curl: (22) The requested URL returned error: 404

Any help?

marco-emmanuel-noto commented 1 year ago

Updating to 1.4.3 worked for me too!

mightystrong commented 1 year ago

Here's a workaround for others that are hitting this:

    steps:
      - browser-tools/install-browser-tools:
          chrome-version: 114.0.5735.90 # TODO: remove -> https://github.com/CircleCI-Public/browser-tools-orb/issues/75

I was using 1.4.3 with no issues until today. But then the issue sprang up on me. I then upgraded to 1.4.4 with no success. Turns out, I still needed to specify the chrome stable version because browser tools was trying to install an unreleased version of chrome/chromedriver. It's trying to install version 116.0.5845.140, but the corresponding chromedriver doesn't exist, so the pipeline failed.

Screenshot 2023-08-29 at 1 25 04 PM

Changing the step to the following worked for me, but I think a more permanent solution would be great. It was unclear without a lot of digging how to fix this. Thanks for all your work on this project.

- browser-tools/install-chrome:
     chrome-version: 116.0.5845.96
mantrala commented 1 year ago

@mightystrong I tried the latest 1.4.4 with the chrome version specified to 116.0.5845.96 and getting an error /bin/bash: line 130: google-chrome-stable: command not found

hoylemd commented 1 year ago

This works for me w/ v1.4.2

    steps:
    - browser-tools/install-browser-tools:
        chrome-version: 116.0.5845.96 # TODO: remove when chromedriver downloads are fixed
    - checkout

It does install firefox and geckodriver too, but at least it runs.

will try it with 1.4.4 momentarily

I also opened another ticket about it #90

hoylemd commented 1 year ago

@mantrala you might need to do an explicit - run: sudo apt-get update step to make installing chrome specifically work:

https://github.com/CircleCI-Public/browser-tools-orb/issues/90#issuecomment-1698052540

0xadada commented 1 year ago

this worked for me

- run: sudo apt-get update
- browser-tools/install-chrome:
    # TODO remove following line when fixed https://github.com/CircleCI-Public/browser-tools-orb/issues/90
    chrome-version: 116.0.5845.96
mightystrong commented 1 year ago

@mantrala Not sure what to recommend without seeing the rest of the config.

hawkrush commented 1 year ago

Thanks @0xadada, that worked for me!

HennaAbbas commented 1 year ago

Hi All,

We recommend specifying a chromedriver-version. This should resolve the issue. The root cause of this issue is the latest release of chrome : https://chromereleases.googleblog.com/

However, a new version of chrome driver was not released that matches that new version which will resolve this issue once it is released for version 116.0.5845.140.

mantrala commented 1 year ago

@hoylemd @0xadada need sudo apt-get update to get the build going. Thank you.

hoylemd commented 1 year ago

Hmm I wonder why my builds don't need apt-get upgrade but some others do.

mine's using

jobs:
  build:
    docker:
    - image: cimg/node:16.16-browsers

maybe that's the key difference w.r.t apt-get update?

sedghi commented 9 months ago

I have this issue in my circleCI

albertski commented 9 months ago

@sedghi What version of browser-tools-orb are you using? Perhaps you need to update to the latest (v1.4.6).