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 install returning 404 and failing to install any backup #102

Open
prpetten opened this issue Feb 1, 2024 · 31 comments
Open

Comments

@prpetten
Copy link

prpetten commented Feb 1, 2024

Orb version

1.4.6

What happened

Went to update our Chrome version to just be set to the latest version by default. Updated our config to read:

      - browser-tools/install-chrome
      - browser-tools/install-chromedriver

That resulted in this error when the "Install Chromedriver" step was hit:

Chrome version major is 121
Installed version of Google Chrome is 121.0.6167.139 
404
Matching Chrome Driver Version 404'd, falling back to first matching major version.
/bin/bash: line 159: jq: command not found
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   863  100   863    0     0  61642      0 --:--:-- --:--:-- --:--:-- 61642
(23) Failed writing body
New ChromeDriver version to be installed: 
 will be installed
curl: (22) The requested URL returned error: 404 
mv: cannot stat 'chromedriver-linux64': No such file or directory
mv: cannot stat 'chromedriver/chromedriver': No such file or directory
chmod: cannot access '/usr/local/bin/chromedriver': No such file or directory
/bin/bash: line 202: chromedriver: command not found
Something went wrong; ChromeDriver could not be installed

Exited with code exit status 1

Also tried manually setting the Chromedriver version (121.0.6167.85), but got the same result. When I reverted to the old version of Chrome we were previously using (114.0.5735.90), everything worked fine.

Expected behavior

Ideally chromedriver would have been installed.

@prpetten prpetten changed the title Chromedriver returning 404 Chromedriver returning 404 and failing to install any backup Feb 1, 2024
@prpetten prpetten changed the title Chromedriver returning 404 and failing to install any backup ChromeDriver install returning 404 and failing to install any backup Feb 1, 2024
@prpetten
Copy link
Author

prpetten commented Feb 1, 2024

Note: If I manually hit the URL below, for the version when I specified it (121.0.6167.85). It returns 200 for me. It appears that is what your script should resolve to

https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/121.0.6167.85/linux64/chromedriver-linux64.zip

However, I do not see the version installed by default (121.0.6167.139) on the list of available versions on the Chrome for Testing site https://googlechromelabs.github.io/chrome-for-testing/

And indeed, when I attempt to visit

https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/121.0.6167.139/linux64/chromedriver-linux64.zip

I get a 404 error. Not sure how you're somehow ahead of the latest stable version? Perhaps Google Chrome reverted to an earlier version.

Not sure why when I manually set the version number I get the same error, as that one returns fine.

@prpetten
Copy link
Author

prpetten commented Feb 1, 2024

Just for fun, I tried manually specifying the last stable v120 version 120.0.6099.109.

      - browser-tools/install-chrome:
          chrome-version: 120.0.6099.109
          replace-existing: true
      - browser-tools/install-chromedriver

It installed Chrome fine, but did not install chromedriver.

Chrome version major is 120
Installed version of Google Chrome is 120.0.6099.109 
404
Matching Chrome Driver Version 404'd, falling back to first matching major version.
/bin/bash: line 159: jq: command not found
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   863  100   863    0     0  57533      0 --:--:-- --:--:-- --:--:-- 57533
(23) Failed writing body
New ChromeDriver version to be installed: 
 will be installed
curl: (22) The requested URL returned error: 404 
mv: cannot stat 'chromedriver-linux64': No such file or directory
mv: cannot stat 'chromedriver/chromedriver': No such file or directory
chmod: cannot access '/usr/local/bin/chromedriver': No such file or directory
/bin/bash: line 202: chromedriver: command not found
Something went wrong; ChromeDriver could not be installed

Exited with code exit status 1

which again is weird, because when I visit:

https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/120.0.6099.109/linux64/chromedriver-linux64.zip

I get a 200. Not sure what would be causing the discrepancy....

@arthurthefourth
Copy link

I think this is an issue with the Chrome stable desktop release channel being different from the Chrome for Testing stable release channel.

The Chrome Releases blog shows 121.0.6167.139 released to stable on Jan. 30, but the Chrome for Testing dashboard shows the latest stable version still at 121.0.6167.85 as of February 1st.

As far as I can tell, the install-chrome script seems to be ignoring Chrome for Testing altogether and just downloading regular desktop versions.

@prpetten
Copy link
Author

prpetten commented Feb 1, 2024

@arthurthefourth That totally makes sense for using the latest.

Still not sure why specifying previous versions with supported chromedrivers is breaking though.

@arthurthefourth
Copy link

I wonder what’s up with that jq: command not found you’re seeing. I saw it mentioned in another issue as well.

@prpetten
Copy link
Author

prpetten commented Feb 1, 2024

I missed that initially. My guess would be that since jq is not installed by default, without a separate installation step, you probably get this result.

If it's a prereq for the orb, probably should add that to the documentation.

Alternatively, it might make sense to see if the script can perform the actions without the overhead of adding an additional binary to the environment.

@prpetten
Copy link
Author

prpetten commented Feb 1, 2024

So looking into the PR history, it looks like jq was recently added to help out with the fallback condition of getting a 404 in the first place.

I'm guessing the assumption was you'd have installed jq on your machine for other purposes. Probably need to add to the documentation

So, if you run it after installing jq, it works...

orbs:
  jq: circleci/[email protected]
  browser-tools: circleci/[email protected]
  #....
    steps:
        - jq/install:
          version: jq-1.7
      - browser-tools/install-chrome
      - browser-tools/install-chromedriver

@tujlaky
Copy link

tujlaky commented Feb 15, 2024

With 1.4.6 I have started to get 404 too when I don't specify a version.

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   7956      0 --:--:-- --:--:-- --:--:--  8000
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

Looks like the fallback is happening but using the same version as before so it is 404 again.

@egorkel-altexsoft
Copy link

I think the problem is here
As stated here, URL should be defferent

@egorkel-altexsoft
Copy link

As a workaround, I can suggest

    steps:
#      Until https://github.com/CircleCI-Public/browser-tools-orb/issues/102 is resolved
#      - browser-tools/install-chrome
#      - browser-tools/install-chromedriver
      - browser-tools/install-browser-tools:
          chrome-version: 114.0.5735.90

@tujlaky
Copy link

tujlaky commented Feb 15, 2024

Looks like now it is 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   8240      0 --:--:-- --:--:-- --:--:--  8298
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

@egorkel-altexsoft
Copy link

I think the problem is here As stated here, URL should be defferent

Never mind, this URL is for 114 and older versions

@arthurthefourth
Copy link

Ah right, I thought you'd linked to install-chrome.sh, not install-chromedriver.sh. I think there are a few separate issues which are getting conflated here:

  1. As I mentioned above, install-chrome.sh seems to be pulling its Chrome versions from the official Chrome stable releases, rather than the Chrome for Testing releases:

CHROME_URL="https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm"

But install-chromedriver.sh is looking for matching versions in Chrome for Testing:

MATCHING_CHROMEDRIVER_URL_RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/$CHROMEDRIVER_VERSION/linux64/chromedriver-linux64.zip')

So when an official release like 121.0.6167.184 comes out before there's a matching Chromedriver version, it 404s looking for the Chromedriver version.

  1. The 404 fallback seems to be breaking if jq isn't installed.

  2. The issue that @tujlaky reported where the fallback was temporarily falling back to the same version.

@tujlaky are there any issues once you've got the right fallback version?

@tujlaky
Copy link

tujlaky commented Feb 15, 2024

No, after the fallback everything is working. I think in my case the json contained a version which was not available to download. This was not an issue with the orb. Thanks for the help

@egorkel-altexsoft
Copy link

Yeah, it looks like the problem was that the new version was not available at https://edgedl.me.gvt1.com
Why don't they use the same URLs for the whole installation process?

@prpetten
Copy link
Author

prpetten commented Feb 16, 2024

It's broken for me again.

Chrome version major is 121
Installed version of Google Chrome is 121.0.6167.85 
404
Matching Chrome Driver Version 404'd, falling back to first matching major version.
/bin/bash: line 159: jq: command not found
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   864  100   864    0     0  66461      0 --:--:-- --:--:-- --:--:-- 66461
(23) Failed writing body
New ChromeDriver version to be installed: 
 will be installed
curl: (22) The requested URL returned error: 404 
mv: cannot stat 'chromedriver-linux64': No such file or directory
mv: cannot stat 'chromedriver/chromedriver': No such file or directory
chmod: cannot access '/usr/local/bin/chromedriver': No such file or directory
/bin/bash: line 202: chromedriver: command not found
Something went wrong; ChromeDriver could not be installed

Exited with code exit status 1

@tujlaky
Copy link

tujlaky commented Feb 19, 2024

For me too

@tujlaky
Copy link

tujlaky commented Feb 19, 2024

I have created a PR because there is a small typo in the script which is preventing the usage of a fix version on the 121 versions.

Eg: the following version will still show a 404: 121.0.6167.85 but that should work with the following:

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

https://github.com/CircleCI-Public/browser-tools-orb/blob/main/src/scripts/install-chromedriver.sh#L156

@arthurthefourth because of this what your are mentioning in 2 will be always a 404 so it will always go for the fallback.

#107

@tujlaky
Copy link

tujlaky commented Feb 19, 2024

Should not this script use the following URL for the download for the newest versions?
https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/linux64/chromedriver-linux64.zip

Which is working for me.

But the one what the script is using is not:
https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/121.0.6167.184/linux64/chromedriver-linux64.zip

From this page:
https://googlechromelabs.github.io/chrome-for-testing/#stable

@matthewhively
Copy link

During chromedriver installation step I got the following output:

Chrome version major is 121
Installed version of Google Chrome is 121.0.6167.184 
A different version of ChromeDriver is installed (ChromeDriver 121.0.6167.85 (3f98d690ad7e59242ef110144c757b2ac4eef1a2-refs/branch-heads/6167@{#1539})); removing it
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  72000      0 --:--:-- --:--:-- --:--:-- 72000
New ChromeDriver version to be installed: 121.0.6167.184
121.0.6167.184 will be installed
/bin/bash: line 164: [[: 121.0.6167.184: syntax error: invalid arithmetic operator (error token is ".0.6167.184")
ChromeDriver 121.0.6167.184 (057a8ae7deb3374d0f1b04b36304d236f0136188-refs/branch-heads/6167@{#1818}) has been installed to /usr/local/bin/chromedriver

so, it installed as expected, but with a BASH error.

@josephfrazier
Copy link

I'm also experiencing the bash syntax error:

Chrome version major is 122
Installed version of Google Chrome is 122.0.6261.57 
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

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   864  100   864    0     0  11464      0 --:--:-- --:--:-- --:--:-- 11520
New ChromeDriver version to be installed: 122.0.6261.57
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

I realize that the script says chromedriver has been installed, but when I try to use a headless chrome via testcafe, it says "No inspectable targets":

ERROR Unable to open the "chrome:headless" browser due to the following error:

Error: No inspectable targets
    at defaultTarget (/home/app/node_modules/chrome-remote-interface/lib/chrome.js:48:23)
    at Chrome._fetchDebuggerURL (/home/app/node_modules/chrome-remote-interface/lib/chrome.js:194:28)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Chrome._start (/home/app/node_modules/chrome-remote-interface/lib/chrome.js:141:25)

Type "testcafe -h" for help.

so I suspect that the chromedriver installation script may not have actually worked...

@josephfrazier
Copy link

josephfrazier commented Feb 21, 2024

EDIT: it was a testcafe problem: DevExpress/testcafe#8145

I realize that the script says chromedriver has been installed, but when I try to use a headless chrome via testcafe, it says "No inspectable targets", so I suspect that the chromedriver installation script may not have actually worked...

Might have to walk this back a bit: I tried pinning chrome to 116:

          - run:
              name: apt-get update
              command: sudo apt-get update
          - browser-tools/install-chrome:
              replace-existing: true
              chrome-version: 116.0.5845.110

and while I still got the bash syntax error, the rest of the CI job worked, so maybe my problem is with testcafe, the browser automation I'm using.

Chrome version major is 116
Installed version of Google Chrome is 116.0.5845.110 
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  13503      0 --:--:-- --:--:-- --:--:-- 13714
New ChromeDriver version to be installed: 116.0.5845.96
116.0.5845.96 will be installed
/bin/bash: line 165: [[: 116.0.5845.96: syntax error: invalid arithmetic operator (error token is ".0.5845.96")
^@^@ChromeDriver 116.0.5845.96 (1a391816688002153ef791ffe60d9e899a71a037-refs/branch-heads/5845@{#1382}) has been installed to /usr/local/bin/chromedriver

CircleCI received exit code 0

@sedghi
Copy link

sedghi commented Feb 22, 2024

Same issue on our end too, I reported it here cypress-io/circleci-orb#459 (comment)

@neospeed83
Copy link

Honestly with how fast Google is releasing chrome versions and the potential delay between a new Google Chrome version being out and the corresponding ChromeDriver version is out, I feel like the best way to go about this is to check the latest stable ChromeDriver version, download corresponding chrome and then install the ChromeDriver for it.

@arthurthefourth
Copy link

@neospeed83 Do you think using the Chrome for Testing binaries for Chrome instead of the official releases isn't an option? That'd certainly be my preference, since those are already matched. But I don't know much about what scenarios this orb has to support. If that way isn't possible, I agree that your suggestion seems like the best way forward.

@diegobayshanntech
Copy link

diegobayshanntech commented Mar 22, 2024

Should we (the users of the orb) look for alternatives as there is no work-around and the PR is just sitting there ?

@tujlaky
Copy link

tujlaky commented Mar 27, 2024

We started to use firefox in the meantime. That looks more stable.

@cartwrightian
Copy link

Seeing similar with 124

Chrome version major is 124
Installed version of Google Chrome is 124.0.6367.60
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 1085 100 1085 0 0 21956 0 --:--:-- --:--:-- --:--:-- 22142
New ChromeDriver version to be installed: 124.0.6367.91
124.0.6367.91 will be installed
curl: (22) The requested URL returned error: 404

Exited with code exit status 22

@markzalar
Copy link

We're seeing this again. We initially specified version 114.0.5735.90 per recommendations above. A couple weeks ago that version stopped working so we switched to 114.0.5735.198. Today that version disappeared.

Google Chrome is not currently installed; installing it
Preparing Chrome installation for Debian-based systems
https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_114.0.5735.198-1_amd64.deb:
2024-05-30 21:22:34 ERROR 404: Not Found.
/bin/bash: line 130: google-chrome-stable: command not found
Google Chrome v114.0.5735.198 (stable) failed to install.

Exited with code exit status 1

Does anyone have a good strategy for quickly identifying a new version that is available? Or a strategy for determining how much longer a given version is likely to be available?

@rjherrera
Copy link

rjherrera commented Jun 13, 2024

we are seeing the same issue as @markzalar and @cartwrightian when specifying versions. In my case the 114.0.5735.X versions.

I tried looking at the chrome releases blog and at the refs in chromium repository for versions and tried several, all with the same results ➡️ the same 404 and failure to install.

I was wondering if there is any way we could specify a mirror url as a parameter for the orb as a temp fix, because I can't seem to find another way. Any help is hugely appreciated.

Edit: I forgot to add that I changed to firefox and all is working as expected, but I'd like to go back to chrome if possible.

@deepakmahakale
Copy link

This started to break again on 17th July 2024 for us

The following worked:

  orbs:
-   browser-tools: circleci/[email protected]
+   browser-tools: circleci/[email protected]

  commands:
    install-chrome:
      steps:
-       - run: sudo apt-get update # TODO: remove when chromedriver downloads are fixed
-       - browser-tools/install-chrome:
-          chrome-version: 116.0.5845.96 # TODO: remove when chromedriver downloads are fixed
+       - browser-tools/install-chrome
        - browser-tools/install-chromedriver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests