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

URL for Chromedriver downloads changed in version >= 121 #104

Closed cbrews closed 7 months ago

cbrews commented 7 months ago

Orb version

1.4.6

What happened

We started to receive this error when installing chromedriver as part of the browsertools orb:

Chrome version major is 121
Installed version of Google Chrome is 121.0.6167.184 
404
Matching Chrome Driver Version 404'd, falling back to first matching major version.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   864  100   864    0     0  13685      0 --:--:-- --:--:-- --:--:-- 13714
New ChromeDriver version to be installed: 121.0.6167.184
121.0.6167.184 will be installed
curl: (22) The requested URL returned error: 404

Exited with code exit status 22

I did some digging and found this commit correlated to the error, a change to the chrome-for-testing repo which is used for version resolution: https://github.com/GoogleChromeLabs/chrome-for-testing/commit/3bfd77e1ea8df7b38651780351ab619f52d19aa2

As of this commit it appears that chromedriver versions >= 121 have migrated from https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing to https://storage.googleapis.com/chrome-for-testing-public.

Current workaround is to pin version 120 (I'm on a debian machine):

      - browser-tools/install-browser-tools:
          chrome-version: 120.0.6099.62

Expected behavior

We should resolve the right version--but it looks like the place these are stored has changed. It also appears that this change is only affecting a subset of versions (121) so just changing the URL to resolve won't be enough, we need to conditionally select https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing for < 121 and https://storage.googleapis.com/chrome-for-testing-public for >= 121

gorner commented 7 months ago

We are seeing this too, but only since this afternoon. Up until this morning a fallback to an earlier build in the same major version was working:

Chrome version major is 121
Installed version of Google Chrome is 121.0.6167.184 
404
Matching Chrome Driver Version 404'd, falling back to first matching major version.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   863  100   863    0     0  45421      0 --:--:-- --:--:-- --:--:-- 45421
New ChromeDriver version to be installed: 121.0.6167.85
121.0.6167.85 will be installed
ChromeDriver 121.0.6167.85 (3f98d690ad7e59242ef110144c757b2ac4eef1a2-refs/branch-heads/6167@{#1539}) has been installed to /usr/local/bin/chromedriver

But now we're getting the same results as @cbrews above.

~It does look like you could pin chrome-version: 121.0.6167.85 and have that work for now.~

Never mind, that fails for different reasons. Chrome 120 it is.

levicole commented 7 months ago

Important to note that you might need something along the lines of this before installing chrome/chrome-driver:

- run:
    name: Apt update # I'm on debian, you might need to replace this...
    command:  sudo apt-get update
jmonteiro commented 7 months ago

Thank you @levicole and @cbrews, indeed this fixed the issue for us for now:

    steps:
      - run:
          # Remove this step once we unpin the chrome-version below
          name: apt update for installing chrome
          command:  sudo apt-get update
      - browser-tools/install-chrome:
          chrome-version: "120.0.6099.224" # Wait until https://github.com/CircleCI-Public/browser-tools-orb/pull/105 is merged and fixes https://github.com/CircleCI-Public/browser-tools-orb/issues/104
      - browser-tools/install-chromedriver
ddh commented 7 months ago

Thanks @cbrews , we're being impacted by this as well but pinning the version is a good short-term fix as others have mentioned.

SemanticallyNull commented 7 months ago

Thank you for providing the workaround here, and the Pull Request. That's now been merged.