titusfortner / webdrivers

Keep your Selenium WebDrivers updated automatically
MIT License
592 stars 113 forks source link

Incorrect version of ChromeDriver being installed? #214

Closed ioquatix closed 3 years ago

ioquatix commented 3 years ago

Summary

Short summary of the bug or feature request.

Debug Info

Please provide the following information for bug reports:

Expected Behavior

Install correct version of ChromeDriver.

Actual Behavior

Install older (incompatible) version of ChromeDriver:

> ~/.webdrivers/chromedriver --version
ChromeDriver 92.0.4515.107 (87a818b10553a07434ea9e2b6dccf3cbe7895134-refs/branch-heads/4515@{#1634})

System already has correct version:

> /usr/bin/chromedriver --version
ChromeDriver 92.0.4515.159 (0185b8a19c88c5dfd3e6c0da6686d799e9bc3b52-refs/branch-heads/4515@{#2052})

Debug Logs

2021-08-18 13:49:42 DEBUG Webdrivers Checking current version
2021-08-18 13:49:42 DEBUG Webdrivers /home/samuel/.webdrivers/chromedriver is not already downloaded
2021-08-18 13:49:42 DEBUG Webdrivers WD_CHROME_PATH: /usr/bin/chromium
2021-08-18 13:49:42 DEBUG Webdrivers making System call: ["/usr/bin/chromium", "--product-version"]
2021-08-18 13:49:42 DEBUG Webdrivers System call returned: 92.0.4515.159

2021-08-18 13:49:42 DEBUG Webdrivers Browser version: 92.0.4515.159
2021-08-18 13:49:42 DEBUG Webdrivers Checking current version
2021-08-18 13:49:42 DEBUG Webdrivers /home/samuel/.webdrivers/chromedriver is not already downloaded
2021-08-18 13:49:42 DEBUG Webdrivers WD_CHROME_PATH: /usr/bin/chromium
2021-08-18 13:49:42 DEBUG Webdrivers making System call: ["/usr/bin/chromium", "--product-version"]
2021-08-18 13:49:42 DEBUG Webdrivers System call returned: 92.0.4515.159

2021-08-18 13:49:42 DEBUG Webdrivers Browser version: 92.0.4515.159
2021-08-18 13:49:42 DEBUG Webdrivers WD_CHROME_PATH: /usr/bin/chromium
2021-08-18 13:49:42 DEBUG Webdrivers making System call: ["/usr/bin/chromium", "--product-version"]
2021-08-18 13:49:43 DEBUG Webdrivers System call returned: 92.0.4515.159

2021-08-18 13:49:43 DEBUG Webdrivers Browser version: 92.0.4515.159
2021-08-18 13:49:43 DEBUG Webdrivers Making network call to https://chromedriver.storage.googleapis.com/LATEST_RELEASE_92.0.4515
2021-08-18 13:49:43 DEBUG Webdrivers Get response: #<Net::HTTPOK 200 OK readbody=true>
2021-08-18 13:49:43 DEBUG Webdrivers Latest version available: 92.0.4515.107
2021-08-18 13:49:43 DEBUG Webdrivers Deleting /home/samuel/.webdrivers/chromedriver.version
2021-08-18 13:49:43 DEBUG Webdrivers WD_CHROME_PATH: /usr/bin/chromium
2021-08-18 13:49:43 DEBUG Webdrivers making System call: ["/usr/bin/chromium", "--product-version"]
2021-08-18 13:49:43 DEBUG Webdrivers System call returned: 92.0.4515.159

2021-08-18 13:49:43 DEBUG Webdrivers Browser version: 92.0.4515.159
2021-08-18 13:49:43 DEBUG Webdrivers Checking current version
2021-08-18 13:49:43 DEBUG Webdrivers /home/samuel/.webdrivers/chromedriver is not already downloaded
2021-08-18 13:49:43 DEBUG Webdrivers WD_CHROME_PATH: /usr/bin/chromium
2021-08-18 13:49:43 DEBUG Webdrivers making System call: ["/usr/bin/chromium", "--product-version"]
2021-08-18 13:49:43 DEBUG Webdrivers System call returned: 92.0.4515.159

2021-08-18 13:49:43 DEBUG Webdrivers Browser version: 92.0.4515.159
2021-08-18 13:49:43 DEBUG Webdrivers WD_CHROME_PATH: /usr/bin/chromium
2021-08-18 13:49:43 DEBUG Webdrivers making System call: ["/usr/bin/chromium", "--product-version"]
2021-08-18 13:49:43 DEBUG Webdrivers System call returned: 92.0.4515.159

2021-08-18 13:49:43 DEBUG Webdrivers Browser version: 92.0.4515.159
2021-08-18 13:49:43 DEBUG Webdrivers Making network call to https://chromedriver.storage.googleapis.com/LATEST_RELEASE_92.0.4515
2021-08-18 13:49:43 DEBUG Webdrivers Get response: #<Net::HTTPOK 200 OK readbody=true>
2021-08-18 13:49:43 DEBUG Webdrivers Latest version available: 92.0.4515.107
2021-08-18 13:49:43 DEBUG Webdrivers chromedriver URL: https://chromedriver.storage.googleapis.com/92.0.4515.107/chromedriver_linux64.zip
2021-08-18 13:49:43 DEBUG Webdrivers Making network call to https://chromedriver.storage.googleapis.com/92.0.4515.107/chromedriver_linux64.zip
2021-08-18 13:49:44 DEBUG Webdrivers Get response: #<Net::HTTPOK 200 OK readbody=true>
2021-08-18 13:49:44 DEBUG Webdrivers Successfully downloaded /tmp/20210818-7168-1b8n3qtchromedriver_linux64.zip
2021-08-18 13:49:44 DEBUG Webdrivers Decompressing /tmp/20210818-7168-1b8n3qtchromedriver_linux64.zip
2021-08-18 13:49:44 DEBUG Webdrivers Completed download and processing of /home/samuel/.webdrivers/chromedriver
2021-08-18 13:49:44 DEBUG Webdrivers Checking current version
2021-08-18 13:49:44 DEBUG Webdrivers /home/samuel/.webdrivers/chromedriver is already downloaded
2021-08-18 13:49:44 DEBUG Webdrivers making System call: ["/home/samuel/.webdrivers/chromedriver", "--version"]
2021-08-18 13:49:44 DEBUG Webdrivers System call returned: ChromeDriver 92.0.4515.107 (87a818b10553a07434ea9e2b6dccf3cbe7895134-refs/branch-heads/4515@{#1634})

2021-08-18 13:49:44 DEBUG Webdrivers Current version of /home/samuel/.webdrivers/chromedriver is ChromeDriver 92.0.4515.107 (87a818b10553a07434ea9e2b6dccf3cbe7895134-refs/branch-heads/4515@{#1634})

2021-08-18 13:49:44 DEBUG Webdrivers A working webdriver version is already on the system
titusfortner commented 3 years ago

The gem is using what Google is telling it to use via: https://chromedriver.storage.googleapis.com/LATEST_RELEASE_92 This is probably manually updated by Google, and they missed doing it. You can raise an issue on chromedriver bug tracker, or you can specify what you need directly in the meantime: Webdrivers::Chromedriver.required_version = 92.0.4515.159

ioquatix commented 3 years ago

I tried:

Webdrivers::Chromedriver.required_version = "92.0.4515.159"

but it failed.

I think one action item here is a way to bypass downloading and/or using webdrivers if a local installed driver is already installed. WDYT?

kapoorlakshya commented 3 years ago

I tried: Webdrivers::Chromedriver.required_version = "92.0.4515.159" but it failed.

I believe that's failing because a chromedriver build exactly matching the browser version is not available. The latest I am seeing is .107, which is what the gem is pulling based on the log you shared.

I think one action item here is a way to bypass downloading and/or using webdrivers if a local installed driver is already installed. WDYT?

It is designed to not download anything if a driver version compatible with the current browser version is found locally. In this case, the browser version is newer than the driver version and Google hasn't put a compatible driver version for the .159 build. As Titus pointed out, this will most likely take a ticket on the chromedriver bug tracker to fix. I'll see if I can report this tomorrow unless you beat me to it :)

ioquatix commented 3 years ago

It is designed to not download anything if a driver version compatible with the current browser version is found locally.

I have already got the correct one installed:

samuel@koyoko ~> chromium --version
Chromium 92.0.4515.159 Arch Linux
samuel@koyoko ~> /usr/bin/chromedriver --version
ChromeDriver 92.0.4515.159 (0185b8a19c88c5dfd3e6c0da6686d799e9bc3b52-refs/branch-heads/4515@{#2052})
AndrewVos commented 2 years ago

Hi @ioquatix I am seeing this exact issue with 94.0.4606.61.

Webdrivers can't download it:

     Webdrivers::ConnectionError:
       Can not reach https://chromedriver.storage.googleapis.com/94.0.4606.61/chromedriver_linux64.zip

And I can't seem to find a way to stop webdrivers from trying to download it. Did you find a workaround?

titusfortner commented 2 years ago

the file is there and downloads (see example below). Is the machine you are running on able to access googleapis.com?

To stop downloads, you can set the required version to the one that is already on your machine, but that kind of defeats the purpose of using the gem in the first place.

SL-1495:code titusfortner$ rm ~/.webdrivers/chromedriver 
SL-1495:code titusfortner$ irb
irb(main):001:0> require 'webdrivers'
=> true
irb(main):002:0> Webdrivers::Chromedriver.required_version='94.0.4606.61'
=> "94.0.4606.61"
irb(main):003:0> Webdrivers::Chromedriver.update
=> "/Users/titusfortner/.webdrivers/chromedriver"
irb(main):004:0> ^C
irb(main):004:0> 
SL-1495:code titusfortner$ ~/.webdrivers/chromedriver --version
ChromeDriver 94.0.4606.61 (418b78f5838ed0b1c69bb4e51ea0252171854915-refs/branch-heads/4606@{#1204})
ioquatix commented 2 years ago

Google seems to lag behind a bit. I'd suggest only downloading and installing it if it doesn't already exist locally. Or if that's already how it's supposed to work, it's not?