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

Webdrivers trying to load a Chrome version that doesn't exist #247

Closed
darinwilson opened this issue Jul 18, 2023 · 81 comments
Closed

Webdrivers trying to load a Chrome version that doesn't exist #247

darinwilson opened this issue Jul 18, 2023 · 81 comments

Comments

@darinwilson
Copy link

Summary

Apologies if this is a dupe of #180 but when running CI on Travis, tests are failing with Webdrivers::VersionError: Unable to find latest point release version for 115.0.5790 - that version does not appear to exist yet (latest is 114)

Debug Info

  • Webdrivers version: 5.2.2
  • Ruby version: 2.7.8
  • Operating system / CI Environment: Linux/Travis
  • Browser and version: Chrome, ideally latest

Expected Behavior

Webdrivers should download latest available version

Actual Behavior

Test fails with the error shown above. This works locally on Apple silicon (I deleted my cached browsers under ~/.webdrivers and ran tests successfully), but not on Travis.

Thank you!

@ryanb
Copy link

ryanb commented Jul 18, 2023

I ran into this as well on both Travis CI and my local. I'm not sure how the version list gets updated, but it appears to be lagging behind the current version since it doesn't contain 115.

Guess we'll need to hard-code it to 114 in the meantime.

Webdrivers::Chromedriver.required_version = "114.0.5735.90"

Note from titusfortnerthis is not a long term solution as it will not work for Chrome v116. See #247 (comment) for options

@kceb
Copy link

kceb commented Jul 18, 2023

Related? https://developer.chrome.com/blog/chrome-for-testing/

I wonder if this should be updated to query https://github.com/GoogleChromeLabs/chrome-for-testing#json-api-endpoints

@ryanb
Copy link

ryanb commented Jul 18, 2023

Related? https://developer.chrome.com/blog/chrome-for-testing/

I wonder if this should be updated to query https://github.com/GoogleChromeLabs/chrome-for-testing#json-api-endpoints

Yes, I agree this is the issue. According to this page version 115+ is available at that JSON API and version 114 and below use the older download page.

@paterlinimatias
Copy link

Also failing with rails 3.1 while deploying to Heroku:

/app/vendor/bundle/ruby/3.1.0/gems/webdrivers-5.2.0/lib/webdrivers/network.rb:19:in `get': Net::HTTPClientException: 404 "Not Found" with https://chromedriver.storage.googleapis.com/LATEST_RELEASE_115.0.5790 (Webdrivers::NetworkError)

@moveson
Copy link

moveson commented Jul 18, 2023

Same problem with a Rails 7.0 app running on Heroku CI.

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 chromedriver version: https://chromedriver.storage.googleapis.com/index.html
  # ./spec/system/visit_person_show_spec.rb:99:in `visit_page'
  # ./spec/system/visit_person_show_spec.rb:57:in `block (3 levels) in <top (required)>'
  # ------------------
  # --- Caused by: ---
  # Webdrivers::NetworkError:
  #   Net::HTTPClientException: 404 "Not Found" with https://chromedriver.storage.googleapis.com/LATEST_RELEASE_115.0.5790

@titusfortner
Copy link
Owner

PRs welcomed.

Or if you are using one of the latest versions of Selenium, you shouldn't need to require this gem any more. 😄

@paterlinimatias
Copy link

Or if you are using one of the latest versions of Selenium, you shouldn't need to require this gem any more. 😄

This seems to work! thanks @titusfortner 🙇‍♂️

@Judahmeek
Copy link

I got This version of ChromeDriver has not been tested with Chrome version 115. in the browser console when I tried using the latest version of selenium-webdriver without webdrivers.

Not necessarily a deal-breaker, but worth noting.

tgxworld added a commit to tgxworld/discourse that referenced this issue Jul 19, 2023
According to the maintainer of the `webdrivers` gem, the gem is no
longer needed if we already have selenium-webdriver installed.

See titusfortner/webdrivers#247 (comment)
@titusfortner
Copy link
Owner

@Judahmeek check to see if you have an old driver on your system. If selenium finds something else on PATH it will use it without updating.

The warning messages will be more clear in the next release of Selenium.

@yourivdlans
Copy link

I tried removing the webdrivers gem and only using selenium-webdriver but it seems to be falling back to version 114.x anyway. Using the latest version of selenium-webdriver (4.10.0).

Got the following output when enabling debug logging for selenium.

Screenshot 2023-07-19 at 10 02 27

@willzoltan
Copy link

We came across this issue too. For those looking for explicit instructions:

We fixed this in our codebase without downgrading Webdrivers::Chromedriver.required_version by removing webdrivers from the gem file and running bundle update selenium-webdriver (since this was already included in our gem file but out of date), as per @titusfortner 's suggestion

@aviralcht
Copy link

I tried removing webdrivers gem and only using selenium-webdriver as per @titusfortner suggestion, however still failing with below error . Using selenium-webdriver (= 3.142.6) version

16:04:00       Selenium::WebDriver::Error::WebDriverError:
16:04:00         Unable to find chromedriver. Please download the server from
16:04:00         https://chromedriver.storage.googleapis.com/index.html and place it somewhere on your PATH.
16:04:00         More info at https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver.
16:04:00       # ./spec/e2e_helper.rb:18:in `block (2 levels) in <top (required)>'

@yourivdlans
Copy link

@aviralcht Does it work after upgrading the selenium-webdriver gem to the latest version?

@aviralcht
Copy link

@aviralcht Does it work after upgrading the selenium-webdriver gem to the latest version?

Let me try upgrading it to latest version

@aviralcht
Copy link

@aviralcht Does it work after upgrading the selenium-webdriver gem to the latest version?

Let me try upgrading it to latest version

Using ruby2.5.5 version, so latest compatible version of selenium-webserver is 4.0.0.

@yourivdlans / @titusfortner will this version help in replacing webdrivers gem and solving this issue?

@titusfortner
Copy link
Owner

titusfortner commented Jul 19, 2023

@yourivdlans And it turns out that Selenium added support for the new location of v115 after Selenium 4.10 was released, so we need to wait for 4.11 to be released, and there's a few things that still need to be done before we can do that.

In the meantime, chromedriver 114 should still work just fine with Chrome 115 even if warnings are displayed.

@titusfortner
Copy link
Owner

titusfortner commented Jul 19, 2023

Selenium and webdrivers gems both only support versions of Ruby that are not EOL. If you can't update to a supported version of Ruby, you'll likely need to monkey patch or manually put the updated driver in a directory on PATH.

@titusfortner
Copy link
Owner

@aviralcht it needs to be Selenium 4.6 or greater, but best experience with Selenium Manager will be using the latest version of Selenium.

@yourivdlans
Copy link

@titusfortner Got it, thanks!

@darinwilson
Copy link
Author

Thanks, everyone for the quick replies! It looks like the TL;DR for solutions is either to:

@titusfortner Since we have two workarounds, I think we can close this, unless you think there should be code changes to webdrivers and we should keep this open?

@titusfortner
Copy link
Owner

I think that Selenium Manager can now do everything that this gem does (and in a better way), but there are likely going to be edge cases or things that need to be addressed.

The real problem is that the second option will break when Chrome v116 is released. By default chromedriver only works for the current and one future version. I suspect there will be people that can't/don't want to update to the latest version of Selenium who want to test Chrome v116+. For those people this gem will likely need to be updated to support it.

It probably isn't even that hard, I just don't have bandwidth right now for it...

@jsocol
Copy link

jsocol commented Jul 19, 2023

For a little extra context, the Chrome team updated the ChromeDriver release process, and isn't publishing new versions to the old location:

  1. The download location for ChromeDriver releases is changing.

    This applies to both the old ChromeDriver Stable + Beta downloads at https://chromedriver.storage.googleapis.com/ as well as the old Canary downloads at https://chromedriver.chromium.org/chromedriver-canary. We’ll stop publishing new downloads to these locations in the future.

    Consult the Chrome for Testing availability dashboard to learn about the new URL format. Use @puppeteer/browsers to easily download and launch browser + driver binaries, or build your own custom solution using our JSON API endpoints.

@titusfortner
Copy link
Owner

Yeah the new Chrome for Testing is going to make it easier to do some cool things. Selenium is eventually going to allow doing automatic browser downloads as well as automatic driver downloads based on what browser version gets passed to the Options class.

shaun-technovation added a commit to Iridescent-CM/technovation-app that referenced this issue Sep 13, 2023
Related to updating selenium-webdriver:
- titusfortner/webdrivers#247 (comment)

Refs: #4176
your added a commit to DFE-Digital/claim-additional-payments-for-teaching that referenced this issue Sep 15, 2023
your added a commit to DFE-Digital/claim-additional-payments-for-teaching that referenced this issue Sep 15, 2023
your added a commit to DFE-Digital/claim-additional-payments-for-teaching that referenced this issue Sep 19, 2023
northeastprince added a commit to northeastprince/aurora that referenced this issue Sep 24, 2023
@TCCDevelopment
Copy link

PRs welcomed.

Or if you are using one of the latest versions of Selenium, you shouldn't need to require this gem any more. 😄

This worked for me. I for some reason still had the webdrivers gem in my Gemfile along with the selenium-webdriver gem. Once I deleted the webdrivers gem and ran bundle update, this error went away. Thank you for your solution.

@pramodshinde
Copy link

This worked for me, deleted the webdrivers gem and ran bundle update selenium-webdriver and added following in rails_helper

Capybara.register_driver :headless_chrome do |app|
  options = Selenium::WebDriver::Chrome::Options.new
  options.add_option('w3c', false)
  %w[headless window-size=1280x1280 disable-gpu].each { |arg| options.add_argument(arg) }
  Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
end

@titusfortner
Copy link
Owner

@pramodshinde
This shouldn't be used and should raise an exception: options.add_option('w3c', false)

disable-gpu hasn't been needed for a few years, and it is suggested that you use headless=new now (https://github.com/GoogleChrome/chrome-launcher/blob/main/docs/chrome-flags-for-tools.md#headless)

@pramodshinde
Copy link

pramodshinde commented Dec 15, 2023

@pramodshinde This shouldn't be used and should raise an exception: options.add_option('w3c', false)

disable-gpu hasn't been needed for a few years, and it is suggested that you use headless=new now (https://github.com/GoogleChrome/chrome-launcher/blob/main/docs/chrome-flags-for-tools.md#headless)

Thanks, I will try without these options, and update 👍

tfidfwastaken added a commit to simpledotorg/simple-server that referenced this issue Dec 20, 2023
Feature specs are breaking on new machines, due to a change in the
endpoint of Chrome webdrivers. The webdrivers gem have solved this
upstream [0], so simply updating the dependency fixes the problem.

[0] titusfortner/webdrivers#247
tfidfwastaken added a commit to simpledotorg/simple-server that referenced this issue Dec 20, 2023
Feature specs are breaking on new machines, due to a change in the
endpoint of Chrome webdrivers. The webdrivers gem have solved this
upstream [0], so simply updating the dependency fixes the problem.

[0] titusfortner/webdrivers#247
@kmazanec
Copy link

kmazanec commented Jan 4, 2024

For anyone else stuck on Ruby 2.7 and Selenium 4.9 - we ran into an issue this week where selenium-manager could no longer find the right driver (maybe because chrome 120 is more than 5 versions ahead of 114 now 🤷 ). So we ended up adding back the webdrivers gem, v5.x, with the disable-build-check flag and it solved the problem.

@titusfortner
Copy link
Owner

Selenium 4.11+ is needed to access the chrome for testing repository.

You should get an error if the browser is 2+ versions ahead of the driver

@ryabrody
Copy link

ryabrody commented Apr 5, 2024

What @kmazanec suggested work also for my rails app (Ruby 2.7, selenium-webdriver (4.9.0), webdrivers (5.3.1)). What i additionally needed to do was:

WebMock.disable_net_connect!(
  allow_localhost: true,
  allow: [
    'https://storage.googleapis.com',
    'https://googlechromelabs.github.io'
  ]
)

As the app is using webmock.

smaboshe added a commit to thoughtbot/upcase that referenced this issue Apr 24, 2024
We have been having issues with the `webdrivers` gem:
```
Webdrivers::VersionError:
 Unable to find latest point release version for 124.0.6367. 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
```

This commit replaces `webdrivers` with `selenium-webdriver` which does
the same things "better".

Ref:
- titusfortner/webdrivers#247
smaboshe added a commit to thoughtbot/upcase that referenced this issue Apr 25, 2024
We have been having issues with the `webdrivers` gem:
```
Webdrivers::VersionError:
 Unable to find latest point release version for 124.0.6367. 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
```

This commit replaces `webdrivers` with `selenium-webdriver` which does
the same things "better".

Ref:
- titusfortner/webdrivers#247
@timbroder
Copy link

The Webdrivers::Chromedriver.required_version = "114.0.5735.90" fix is no longer working as of today

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.90-1_amd64.deb:
2024-05-16 13:08:46 ERROR 404: Not Found.
/bin/bash: line 129: google-chrome-stable: command not found
Google Chrome v114.0.5735.90 (stable) failed to install.

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