webdrivers: Webdrivers trying to load a Chrome version that doesn't exist

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!

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 78
  • Comments: 77 (29 by maintainers)

Commits related to this issue

Most upvoted comments

So there are multiple different issues

  1. webdrivers gem is no longer looking in the right spot for chromedriver v115 (fixable if we don’t deprecate this gem)
  2. you can set the required version for chromedriver to v114 and it will work for Chrome v115 (but will break for Chrome v116)
  3. the current chromedriver v115 only works with Chrome for Testing, not the default installed version of Chrome. So you need to set the binary location of the browser even if you have the right driver (Google is fixing - https://bugs.chromium.org/p/chromium/issues/detail?id=1466427)

(Updating to Selenium 4.10 and removing this gem is essentially doing the same as point 2)

This PR will fix most of this in Selenium 4.11 which we’re hoping to get released in the next day or so - https://github.com/SeleniumHQ/selenium/pull/12398

Near future options

  1. You can update to Selenium 4.11 and remove webdrivers gem
  2. If you can’t update to latest Selenium (including Ruby 3+), you can set required chromedriver version to 114 and disable build check and hope for the best with all future browser updates.

Longer term options

  1. Webdrivers is deprecated and everyone updates to the latest version of Selenium because Selenium itself will be automatically managing both browsers and drivers, which is pretty exciting.
  2. Webdrivers updates to look for chromedriver v115+ in the new location. (If someone wants to PR something, I’ll merge it short term). This would still require Ruby 3.x & Selenium 4.x.
  3. Webdrivers wraps the Selenium Manager functionality in a less restrictive way. I’d have to split out selenium-manager features and put it in its own gem with less restrictive Selenium/Ruby version requirements. This is probably better than the second option for a number of reasons, but I’m not sure it is worth it.

If you can’t update to latest Selenium and/or Ruby 3.x and want a better solution from this gem, can you give a ☹️ reaction to this comment?

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 https://github.com/titusfortner/webdrivers/issues/247#issuecomment-1648154088 for options

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

@jrochkind

TL/DR - update to Selenium 4.11 when it comes out and everything webdrivers has done should “just work” for 99% of users.

If Selenium finds a driver on PATH it assumes that’s the one you want to use, and (for now/probably until Selenium 5) it will not automatically remediate. Selenium Manager is still “opt-in.” It will only do things if what you explicitly request is wrong, or the code would otherwise fail.

WARN Selenium [:selenium_manager] Error getting version of chromedriver 115. Retrying with chromedriver 114 (attempt 1/5)

This is because the code to look in the Chrome for Testing location for drivers (necessary for 115) was not added in time for Selenium 4.10. 😞 Thankfully chromedriver 114 will still works for Chrome v115, but it will break when Chrome v116 comes out.

I am having trouble understanding if/how that applies to my case

No. It would be an issue if you manually downloaded chromedriver v115 and tried to use it. Because Selenium 4.10 ends up using chromedriver v114 this isn’t a problem.

Selenium 4.11 (out soon, I promise, blame the Java code) will:

  • Output a warning message if it finds an old/ invalid driver on PATH
  • Look in the CfT location for the driver
  • Look for system installed Chrome and if found, will download appropriate driver if necessary, and add the browser location to the options class which will get around the aforementioned chromedriver bug.
  • If Chrome is not found on the system, it will download the latest stable version by default!
  • It will use/download Chrome based on the browser_version passed into the Options::Chrome class. It will accept:
    • “113”
    • “114”
    • “115”
    • “116”
    • “117”
    • “dev”
    • “beta”
    • “canary”

So sorry for this brief period of things being in a bad place. If CfT came out one version later, or if we’d had a little more bandwidth last month, Selenium would have had better errors/warnings for many of these problems. ☹️
But it’s made it really easy to implement the final two bullets there (which were just added and tested over the weekend).

Things will be much better soon. Thank you!

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?

PRs welcomed.

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

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.

Thank you to all the contributors of this gem. It helped run our tests. Moving to updated selenium-webdriver and removing this gem fixed above issue.

@jrochkind yes this is more confusing than it should be.

I guess this will work as long as the version of Chrome that exists on the system is compatible with this verison of chromedriver

ChromeDriver version matches the same version of Chrome or V+1 of Chrome (to give users time to upgrade). If you want to match more broadly, you have to pass in an argument to ignore the build check.

Github Actions has the driver on PATH, and that gets used if webdrivers is not used. I think it’s still set at Chrome v114 for the same reasons everyone else is scrambling to change where they get drivers/browsers. 😄

Webdrivers will continue to support Ruby 2.6+ (I previously thought I’d updated this, but I did not and there’s no reason to do so now). Chrome v115 support in this gem hopefully out later today.

My workaround for this on ruby 2.72, capybara: 3.37.1, selenium-webdriver: 4.9.0, webdrivers: 5.2.0:

Capybara.server = :webrick

Capybara.register_driver :selenium_chrome do |app|
  capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
    'goog:chromeOptions'=> {"args" => ['headless'] }
  )

  service_args = %w[--disable-build-check]
  service = Selenium::WebDriver::Service.chrome(args: service_args)
  
  Capybara::Selenium::Driver.new(
    app,
    :browser => :chrome,
    :capabilities => capabilities,
    :service => service
  )
end

Capybara.javascript_driver = :selenium_chrome
Webdrivers::Chromedriver.required_version = '114.0.5735.90'

thanks for the inspo: https://twitter.com/jeremysmithco/status/1695089140373553266

I took a stab at breaking out the code for Selenium Manager, that could let us release that as a separate gem, and webdrivers 6 could then be a thin wrapper of selenium-manager.gem. Because that code would essentially only be one class, it should be easy enough to make it more flexible with older versions.

Yes, that happened because the old version of Selenium Manager was not prepared to parse the CfT endpoints, and as a result, this strange behavior occurred. But it is consistent with the Selenium Manager logic since it is trying to parse the content of https://chromedriver.storage.googleapis.com/LATEST_RELEASE_115 (which is no longer available as of Chrome 115) to discover the chromedriver version. A closer look at the response to that request is an XML error file like the following:

<?xml version='1.0' encoding='UTF-8'?><Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Details>No such object: chromedriver/LATEST_RELEASE_115</Details></Error>

Internally, Selenium-Manager uses a regex expression to parse the version from the response (numbers and dots), and as a result, the “version” 1.08.115 is obtained. Which, obviously, is incorrect. Eventually, there is an error trying to find that incorrect version.

The solution is to release Selenium 4.11.0 with the new version of Selenium Manager, which already uses the CfT endpoints for Chrome/chromedriver version discovery.

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.

I am not totally sure why I just started encountering this problem today (same error message as at top), when I haven’t updated any gem versions lately, and the new Chrome version that triggered things has been out for a week or so? I guess something changed in the Github Actions CI environment, where I am now encountering the error – perhaps caching.

I have read this whole thread trying to understand what’s going on, and now understand… some things.

But trying to remove webdrivers from my Gemfile, with:

  • ruby 3.2.2
  • selenium-webdriver 4.10.0
  • MacOS 12.6.7
  • a standard desktop self-updating Chrome on my system, at 114.0.5735.198

When running tests locally on that MacOS box, all of my selenium/chrome-using tests raise this error and do not work:

Selenium::WebDriver::Error::SessionNotCreatedError:
  session not created: This version of ChromeDriver only supports Chrome version 103
  Current browser version is 114.0.5735.198 with binary path /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

Right, indeed I have a standard desktop Chrome installed at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome, and it is the latest self-updating version, as per usual…

I don’t really understand where it’s getting what version of “ChromeDriver” that wants chrome 103…

This is perhaps point 3 that @titusfortner mentioned? Or maybe not?

  1. the current chromedriver v115 only works with Chrome for Testing, not the default installed version of Chrome. So you need to set the binary location of the browser even if you have the right driver (Google is fixing - https://bugs.chromium.org/p/chromium/issues/detail?id=1466427)

I am not sure? I am having trouble understanding if/how that applies to my case and what to do about it if so.

I guess the temporary fix is to set Webdrivers::Chromedriver.required_version = "114.0.5735.90", and hope that a more permanent fix comes out before that stops working?

Very odd that this is all blowing up in apparently several different ways all at once. Thank you for your work on webdrivers that has kept things working without me having to think about it for so long – but now I’m really stymied, and not sure how to get unstuck.

UPDATE

OKAY, after googling, I realized I had an old brew install of chromedriver… with webdrivers it was ignored and didn’t cause a problem, but without it, selenium was using that old one and causing a problem.

brew remove chromedriver was necessary.

After that, running my tests on my MacOS system as above (selenium-webdriver 4.10.0, no webdrivers gem) , I get this message in console:

WARN Selenium [:selenium_manager] Error getting version of chromedriver 115. Retrying with chromedriver 114 (attempt 1/5)

I don’t really understand what’s going on there or if it’s expected according to above analysis… but despite the warning it currently works and my tests pass again.

is there any chance of this being backported to a version with Ruby 2.7 support?

It’s unlikely. The open source devs in this ecosystem are pretty comfortable limiting our energies to supported versions of Ruby. I suppose if there was enough interest we could figure out a bounty for it.

1.08.115 is unexpected. @bonigarcia any ideas where that’s coming from?

@alexventuraio that’s this issue - https://github.com/teamcapybara/capybara/issues/2666 Upgrade capybara as well.

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.

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.

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

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.

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

@ecpantalone you don’t need a workaround or to upgrade things to get it to work with 5.3 Thanks for posting the Twitter link, I replied there as well

Fixed releases.

Oh, I forgot to update that. Thank you for pointing it out!

@n8williams for clarity, what keeps you from using webdrivers 5.3?

@titusfortner My inability to read relevant comments, and the latest Changelog are what kept me from using 5.3 😄 🤦 I really appreciate the updates, that did the trick. I’ll edit my comment for currentness. Though it is odd the releases section on the homepage for github is on 5.2, but the gem page is up to date.

5.3 did the trick until we can update our selenium-webdriver gem.

I appreciate the fork provided by @mascolim. Unfortunately we used a newer version of webdrivers but still could not update to the latest version of selenium-webdriver and were stuck around gem 'selenium-webdriver', '~> 4.0.3' since we need to update things to Rails 6. This made it so we could not use the Selenium 3 based updates (Incompatible with Selenium 4+). That’s all a mouthful, but I am done trying to describe the annoying version interplay.

For Selenium 4+ support, I made a patch based on that fork for the case you are using a selenium-webdriver gem > 4.0 but less than the latest release, and are relying on a webdrivers gem > 4.5.0. Link below for the off chance someone else is in the same painful scenario.

See: https://github.com/n8williams/webdrivers

UPDATE: If you update to 5.3, this is likely not needed! gem 'webdrivers', '~> 5.3.0'

Just want to add that I solved the error originally posted in this issue by updating Capybara from 3.39.0 -> 3.39.2 And I ditched webdrivers and only use selenium-webdriver (but that alone did not fix it - the capybara upgrade was the key).

@dtoms It may be because I’m running in Windows? This is one of the replies in the chromium bug thread.

It turns out Windows is not actually affected by this specific issue, as it hard-codes “chrome.exe” (c.f. https://source.chromium.org/chromium/chromium/src/+/refs/heads/main:chrome/common/chrome_constants.cc;l=71;drc=a328097ef1d47f51e76917b80110863037f4f744).

But we may want to update it anyway for consistency.

tested with chrome 115.0.5790.110. chromedriver 115.0.5790.102 (win32. This is because Webdrivers 4.5.0 only picked up 32 bit versions so I’ve ported the same behavior. I don’t know if this could influence behavior too). selenium-webdriver 3.142.7 jruby 9.2.0.0(Ruby: 2.5.0)

Updating to Ruby 3 is going to take awhile for my projects. I’d like to migrate them gracefully and prevent test failures once chrome 116 releases.

I’ve forked Webdrivers version 4.5.0 which was working well for selenium 3 and updated the Chromedriver class to use the new endpoints for fetching the latest point release and fetching the download url. The System class also needed an update as the zip archive now has a parent directory to the chromedriver file.

Others in a similar situation might find this useful.

https://github.com/mascolim/webdrivers/tree/jsonendpoints

I’m stuck on older ruby for several more months and my planned, but not yet built, solution is simply going to be to use the https://developer.chrome.com/blog/chrome-for-testing/#how-can-i-get-chrome-for-testing-binaries npx commands to get the latest browser and driver, as a poor man’s webdrivers solution.

@alexventuraio that’s this issue - teamcapybara/capybara#2666 Upgrade capybara as well.

Thanks for you response @titusfortner as in my previous comment I had already upgraded both selenimum-webdrivers and capybara gems to their latest versions 4.10.0 and v3.39.2 respectively. But nevertheless, I still had the issue with the webdriver not found:

Selenium::WebDriver::Error::NoSuchDriverError:
              Unable to obtain chromedriver using Selenium Manager; Unsuccessful command executed: ["/Users/alex/.rvm/gems/ruby-3.0.6@devpost-teams/gems/selenium-webdriver-4.10.0/bin/macos/selenium-manager", "--browser", "chrome", "--output", "json"]
              Wrong browser/driver version; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location

I did what is stated in this https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location/ and I had to download and put the binary somewhere in my path.

Is that they way it should work for now having both gems up to date?

I tried using selenium-webdriver directly, but the thing is, that we need to configure VCR to ignore requests to the webdriver URLs (see also https://blog.pablobm.com/2021/10/14/vcr-webdriver-errors.html:

VCR.configure do |c|
  driver_hosts = Webdrivers::Common.subclasses.map { |driver| URI(driver.base_url).host }
  c.ignore_hosts(*(%w[127.0.0.1 localhost] + driver_hosts))

Is there a way to do this with selenium-webdriver as well and is it even necessary to do so?

@titusfortner Got it, thanks!

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

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 🙇‍♂️