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

Chromedriver URL problem #108

Closed
ugorsahin opened this issue Feb 20, 2024 · 16 comments · Fixed by #109
Closed

Chromedriver URL problem #108

ugorsahin opened this issue Feb 20, 2024 · 16 comments · Fixed by #109

Comments

@ugorsahin
Copy link

Orb version

1.4.7

What happened

The URL doesn't exist.

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  16301      0 --:--:-- --:--:-- --:--:-- 16301
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
@delusioninabox
Copy link

Is there a workaround for this or ETA on when the fix will be shipped? None of my Cypress tests can currently run, which blocks me from moving anything to staging or prod since it's a requirement for the deployment step.

@ugorsahin
Copy link
Author

ugorsahin commented Feb 21, 2024

Perhaps you can try older versions of the orb as a workaround.

@darryn02
Copy link

darryn02 commented Feb 22, 2024

Running with 1.4.7 gives the following:

Chrome version major is 122
Installed version of Google Chrome is 122.0.6261.57 
500
122.0.6261.57 will be installed
/bin/bash: line 165: [[: 122.0.6261.57: syntax error: invalid arithmetic operator (error token is ".0.6261.57")
ChromeDriver 122.0.6261.57 (87957e464700ccf3468df47ce741e0dc089e0544-refs/branch-heads/6261@{#853}) has been installed to /usr/local/bin/chromedriver

Tests seem to be running though... 🤷

UPDATE: Build passed

@vietqhoang
Copy link

vietqhoang commented Feb 22, 2024

I am experiencing the following issue with 1.4.7

Chrome version major is 116
Installed version of Google Chrome is 116.0.5845.140 
500
116.0.5845.140 will be installed
/bin/bash: line 165: [[: 116.0.5845.140: syntax error: invalid arithmetic operator (error token is ".0.5845.140")
curl: (22) The requested URL returned error: 404

Exited with code exit status 22

The only browser-tool step we have in our config is the following:

browser-tools/install-chromedriver

@vietqhoang
Copy link

Perhaps you can try older versions of the orb as a walkaround.

It seems falling back to an old version of the orb is not a solution due to how Google updated their CDN (#105).

@billy1kaplan
Copy link

billy1kaplan commented Feb 22, 2024

CI is also blocked for us due to this issue:

On browser-tools: circleci/browser-tools@1.4.6:

Chrome version major is 116
Installed version of Google Chrome is 116.0.5845.140 
500
116.0.5845.140 will be installed
curl: (22) The requested URL returned error: 500
curl: (22) The requested URL returned error: 500
curl: (22) The requested URL returned error: 500
curl: (22) The requested URL returned error: 500

Exited with code exit status 22

On browser-tools: circleci/browser-tools@1.4.7:

Chrome version major is 116
Installed version of Google Chrome is 116.0.5845.140 
500
116.0.5845.140 will be installed
/bin/bash: line 165: [[: 116.0.5845.140: syntax error: invalid arithmetic operator (error token is ".0.5845.140")
curl: (22) The requested URL returned error: 404

Exited with code exit status 22

And more broadly, this is probably the 3rd time CircleCI has failed for multiple hours for us in the last ~12 months or so due to this exact same issue. Have we configured things correctly on our end? How can we make this more reliable?

@EvieGillie
Copy link

EvieGillie commented Feb 22, 2024

Ran into this too, got it to work with

      - browser-tools/install-chrome:
          replace-existing: true
          chrome-version: 116.0.5845.110

also got this to work:

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

@berniechiu
Copy link

Broken again today

Screen Shot 2024-02-22 at 11 48 52 AM

@olleolleolle
Copy link

olleolleolle commented Feb 22, 2024

👋 Hello, people.

We experienced this problem.

I took a look at PR #109. That script's idea to download chrome driver looks good. I wanted that.

So, I saved that script locally as script/circleci/install_chromedriver.sh and gave it chmod +x.

...and replaced the CI configuration's browser-tools/install-browser-tools with a run step to invoke the script instead.

    - browser-tools/install-chrome: {}
    - run:
        name: 'Installing browser tools: ChromeDriver'
        command: script/circleci/install_chromedriver.sh

Then I modified the script:

  • add the default value for the parameter the Orb uses "where to store the downloaded binary" (we're outside of an Orb)
  • quoted a few values
  • used jq --raw-output to remove JSON quotes

Details and full script: https://gist.github.com/olleolleolle/c416bc6272ebaa47d3959fb84d962c83

Here are my differences (pointing left) vs the PR's version.

31,33d30
< # Print jq version
< jq -V
< ORB_PARAM_DRIVER_INSTALL_DIR=/usr/local/bin # default value see https://circleci.com/developer/orbs/orb/circleci/browser-tools#commands-install-browser-tools
35c32
< # shellcheck disable=SC2001
---
> # shellcheck disable=SC2001 
143c140
<     CHROMEDRIVER_VERSION=$(echo "$CHROME_VERSION" | sed 's/[^0-9.]//g')
---
>     CHROMEDRIVER_VERSION=$(echo $CHROME_VERSION | sed 's/[^0-9.]//g')
162,163c159,160
< else
<   MATCHING_CHROMEDRIVER_DOWNLOAD_URL=$(curl --silent https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json | jq --arg chromeDriverVersion "$CHROMEDRIVER_VERSION" --arg platform "$PLATFORM" '.versions[] | select(.version=="\($chromeDriverVersion)") | .downloads.chromedriver[] | select(.platform=="\($platform)") | .url')
---
> else 
>   MATCHING_CHROMEDRIVER_DOWNLOAD_URL=$(curl https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json | jq --arg chromeDriverVersion $CHROMEDRIVER_VERSION --arg platform $PLATFORM '.versions.[] | select(.version=="\($chromeDriverVersion)") | .downloads.chromedriver.[] | select(.platform=="\($platform)") | .url')
166,167c163,164
<     CHROMEDRIVER_VERSION=$(curl --silent https://googlechromelabs.github.io/chrome-for-testing/latest-versions-per-milestone.json | jq --raw-output ".milestones[\"$CHROME_VERSION_MAJOR\"].version")
<     CHROMEDRIVER_DOWNLOAD_URL=$(curl --silent https://googlechromelabs.github.io/chrome-for-testing/latest-versions-per-milestone-with-downloads.json | jq --raw-output --arg chromeVersion "$CHROME_VERSION_MAJOR" --arg platform "$PLATFORM" '.milestones["\($chromeVersion)"].downloads.chromedriver[] | select(.platform=="\($platform)") | .url')
---
>     CHROMEDRIVER_VERSION=$( curl https://googlechromelabs.github.io/chrome-for-testing/latest-versions-per-milestone.json | jq ".milestones.\"$CHROME_VERSION_MAJOR\".version" | sed 's/\"//g')
>     CHROMEDRIVER_DOWNLOAD_URL=$(curl https://googlechromelabs.github.io/chrome-for-testing/latest-versions-per-milestone-with-downloads.json | jq --arg chromeVersion $CHROME_VERSION_MAJOR --arg platform $PLATFORM '.milestones."\($chromeVersion)".downloads.chromedriver.[] | select(.platform=="\($platform)") | .url')
169d165
<     echo "New ChromeDriver download URL: $CHROMEDRIVER_DOWNLOAD_URL"

@liamnichols
Copy link

liamnichols commented Feb 22, 2024

We're getting the same issue. It looks like the script is detecting that the latest installed version of Chrome is 116.0.5845.140 (pay attention to the trailing 0).

When it tries to download the corresponding driver, that is a 404:

https://storage.googleapis.com/chrome-for-testing-public/116.0.5845.140/linux64/chromedriver-linux64.zip

But it seems that this is because the known good version is actually 116.0.5845.14, so the correct download link is the following:

https://storage.googleapis.com/chrome-for-testing-public/116.0.5845.14/linux64/chromedriver-linux64.zip


122.0.6261.57 seems to work

$ curl --silent https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions.json | jq -r '.channels.Stable.version'

@carboni-rob
Copy link

122.0.6261.57 seems to work

Not for us unfortunately:

Installed version of Google Chrome is 122.0.6261.57 
ChromeDriver 122.0.6261.57 will be installed
122.0.6261.57 will be installed
curl: (22) The requested URL returned error: 500
curl: (22) The requested URL returned error: 500
curl: (22) The requested URL returned error: 500
curl: (22) The requested URL returned error: 500

Exited with code exit status 22

@liamnichols
Copy link

@carboni-rob, which executor are you using? 122.0.6261.57 worked on the Docker executor.


I have realised why I was getting very confused using this orb.. The default value for chrome-version is latest, so I had assumed that it was always installing the latest version and for some reason, the latest version wasn't actually right.

But it was actually not installing the latest version because replace-existing defaults to false. This meant that we had been using the version of Chrome installed as part of our Docker image:

https://github.com/CircleCI-Public/cimg-ruby/blob/09cb77c4edf40cecf572f443088202b1bd61358c/3.1/browsers/Dockerfile#L52-L60

This version happened to be 116.0.55845.140, which is what has caused issues because supposedly installing older versions is not supported:

Install Google's Chrome browser, for use in browser testing. Note:
only the latest stable release can be installed, as Google does not
maintain a public archive of previous releases. Supports Debian/Ubuntu
Linux, Alpine Linux (via Chromium), and macOS environments.

So maybe the correct usage for this is to leave chrome-version set to latest, but to set replace-existing to true.

@AndyStabler
Copy link

We're doing a less than comparison of the chrome version (which is a string with dots in it) to "121", which blows up with invalid arithmetic operator. I created a draft PR that performs that comparison against the major version instead.

Would be good to get some eyes on it to see if I've misunderstood what's happening! 😄 #111

@timdiggins
Copy link

FWIW if you just need chromedriver for selenium testing and you're using a recent selenium (4.11+) then you can delete the install chromedriver step and let selenium automatically install chromedriver (https://www.selenium.dev/documentation/selenium_manager/). No significant change of speed of running of my specs by doing this.

jrmhaig added a commit to ministryofjustice/Claim-for-Crown-Court-Defence that referenced this issue Feb 22, 2024
Whilst investigating problems with the downloading of chromedriver in the
circleci pipelines (see CircleCI-Public/browser-tools-orb#108)
it turns out that install-chrome is not required for the cucumber tests.
@carboni-rob
Copy link

@liamnichols we are using docker cimg/node:20.8.1-browsers for that job

@axlekb
Copy link

axlekb commented Feb 23, 2024

To save anyone some time that still may come to this thread use 1.4.8:

orbs: 
  browser-tools: circleci/browser-tools@1.4.8

kirushik added a commit to kirushik/critical_chain that referenced this issue Jul 30, 2024
Should be fixing Chrome version not found issues, see CircleCI-Public/browser-tools-orb#108 (comment) for more info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet