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)
Links to this issue
Commits related to this issue
- DEV: Remove webdrivers gem that is causing problem with updating chrome According to the maintainer of the `webdrivers` gem, the gem is no longer needed if we already have selenium-webdriver installe... — committed to tgxworld/discourse by tgxworld a year ago
- Replace webdrivers with selenium-webdriver Our CircleCI build is failing, same issue as described here: https://github.com/titusfortner/webdrivers/issues/247 Trying out a fix, mentioned here: https:... — committed to Iridescent-CM/technovation-app by shaun-technovation a year ago
- Remove webdrivers gem https://github.com/titusfortner/webdrivers/issues/247 — committed to kyamaguchi/amazon_order by kyamaguchi a year ago
- Fix: Temporarily pin Webdrivers::Chromedriver.required_version Webdriver is trying to load a Chrome version that doesn't exist. See https://github.com/titusfortner/webdrivers/issues/247#issuecomment-... — committed to asideofcode-dev/planner by asideofcode-dev a year ago
- Remove webdrivers gem https://github.com/titusfortner/webdrivers/issues/247 — committed to kyamaguchi/kindle_manager by kyamaguchi a year ago
- Remove webdrivers We are seeing a series of errors in CircleCI related to a mismatch in the chromedriver version: https://app.circleci.com/pipelines/github/sul-dlss/was-registrar-app/1308/workflows/... — committed to sul-dlss/was-registrar-app by edsu a year ago
- Remove webdrivers gem More info: https://github.com/titusfortner/webdrivers/issues/247#issuecomment-1641139415 — committed to shakacode/react-webpack-rails-tutorial by ahangarha a year ago
- Remove webdrivers gem It may no longer be neccessary, selenium-webdrivers can handle webdriver install itself? And webdrivers may now be causing a problem? Very unclear what is going on, trying this... — committed to sciencehistory/scihist_digicoll by jrochkind a year ago
- Remove webdrivers (#536) * Remove webdrivers gem More info: https://github.com/titusfortner/webdrivers/issues/247#issuecomment-1641139415 * Update gems * Remove require for webdrivers — committed to shakacode/react-webpack-rails-tutorial by ahangarha a year ago
- fixed up a few tests and pegged Chrome version in due to an issue with Webdrivers: https://github.com/titusfortner/webdrivers/issues/247 — committed to CDLUC3/dmptool by briri a year ago
- Remove "require webdrivers" https://github.com/titusfortner/webdrivers/issues/247 — committed to unboxed/bops by deleted user a year ago
- Remove `webdrivers` (#72) https://github.com/titusfortner/webdrivers/issues/247#issuecomment-1641139415 — committed to hackclub/hackathons-backend by northeastprince a year ago
- Remove webdrivers gem since selenium-webdriver is updated to 4.10 https://github.com/titusfortner/webdrivers/issues/247 — committed to rubyforgood/casa by littleforest a year ago
- Remove webdrivers gem since selenium-webdriver is updated to 4.10 (#5011) https://github.com/titusfortner/webdrivers/issues/247 — committed to rubyforgood/casa by littleforest a year ago
- remove gem webdrivers and update gem selenium-webdriver reference: https://github.com/titusfortner/webdrivers/issues/247#issuecomment-1641879165 — committed to democrateam/consul by microweb10 a year ago
- remove gem webdrivers and update gem selenium-webdriver reference: https://github.com/titusfortner/webdrivers/issues/247#issuecomment-1641879165 — committed to StemvanGroningen/consul by microweb10 a year ago
- remove gem webdrivers and update gem selenium-webdriver reference: https://github.com/titusfortner/webdrivers/issues/247#issuecomment-1641879165 — committed to StemvanGroningen/consul by microweb10 a year ago
- remove gem webdrivers and update gem selenium-webdriver reference: https://github.com/titusfortner/webdrivers/issues/247#issuecomment-1641879165 — committed to participaponferrada/consul by microweb10 a year ago
- remove gem webdrivers and update gem selenium-webdriver reference: https://github.com/titusfortner/webdrivers/issues/247#issuecomment-1641879165 — committed to StemvanGroningen/consul by microweb10 a year ago
- remove gem webdrivers and update gem selenium-webdriver reference: https://github.com/titusfortner/webdrivers/issues/247#issuecomment-1641879165 — committed to StemvanGroningen/consul by microweb10 a year ago
So there are multiple different issues
(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
Longer term options
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.
Note from titusfortner — this 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_versionby removingwebdriversfrom the gem file and runningbundle 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.
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.
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:
browser_versionpassed into theOptions::Chromeclass. It will accept: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:
selenium-webdriverand remove thewebdriversgem, if you can (this worked for me); orrequired_versionto a known good version@titusfortner Since we have two workarounds, I think we can close this, unless you think there should be code changes to
webdriversand 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. 😄
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.
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
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.
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:
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:
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.
This worked for me. I for some reason still had the
webdriversgem in my Gemfile along with theselenium-webdrivergem. Once I deleted thewebdriversgem and ranbundle 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
webdriversfrom my Gemfile, with:When running tests locally on that MacOS box, all of my selenium/chrome-using tests raise this error and do not work:
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?
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
brewinstall of chromedriver… withwebdriversit was ignored and didn’t cause a problem, but without it, selenium was using that old one and causing a problem.brew remove chromedriverwas necessary.After that, running my tests on my MacOS system as above (selenium-webdriver 4.10.0, no
webdriversgem) , I get this message in console: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.
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:
I tried removing the
webdriversgem and only usingselenium-webdriverbut it seems to be falling back to version 114.x anyway. Using the latest version ofselenium-webdriver(4.10.0).Got the following output when enabling debug logging for selenium.
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 ofselenium-webdriverwithoutwebdrivers.Not necessarily a deal-breaker, but worth noting.
Same problem with a Rails 7.0 app running on Heroku CI.
@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!
@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.3did the trick until we can update ourselenium-webdrivergem.I appreciate the fork provided by @mascolim. Unfortunately we used a newer version of
webdriversbut still could not update to the latest version ofselenium-webdriverand were stuck aroundgem '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-webdrivergem > 4.0 but less than the latest release, and are relying on awebdriversgem > 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.
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
npxcommands to get the latest browser and driver, as a poor man’s webdrivers solution.Thanks for you response @titusfortner as in my previous comment I had already upgraded both
selenimum-webdriversandcapybaragems to their latest versions 4.10.0 and v3.39.2 respectively. But nevertheless, I still had the issue with the webdriver not found: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
VCRto ignore requests to the webdriver URLs (see also https://blog.pablobm.com/2021/10/14/vcr-webdriver-errors.html:Is there a way to do this with
selenium-webdriveras 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.
This seems to work! thanks @titusfortner 🙇♂️