Skip to content
This repository has been archived by the owner on Apr 1, 2019. It is now read-only.

Version selection with LATEST_RELEASE is deprecated #79

Closed
starsirius opened this issue Mar 13, 2019 · 17 comments
Closed

Version selection with LATEST_RELEASE is deprecated #79

starsirius opened this issue Mar 13, 2019 · 17 comments

Comments

@starsirius
Copy link

We've been getting chrome not reachable errors in our CircleCI builds since Chrome 73 was released. It seemed like chromedriver-helper was still installing Chromedriver 2.46 as the error message showed

Selenium::WebDriver::Error::WebDriverError:
  chrome not reachable
    (Session info: headless chrome=73.0.3683.75)
    (Driver info: chromedriver=2.46.628388 (4a34a70827ac54148e092aafb70504c4ea7ae926),platform=Linux 4.10.0-35-generic x86_64)

Currently chromedriver-helper fetches the latest chromedriver version via https://chromedriver.storage.googleapis.com/LATEST_RELEASE. It's now deprecated as in the thread, and we should switch to the new way of version selection.

We are testing if updating to the matching version manually will resolve the issue for the time being:

chromedriver-update 73.0.3683.68
@nshki
Copy link

nshki commented Mar 13, 2019

@starsirius We've been getting the same error as of today. Please keep us posted, I'll be watching this issue.

@ioquatix
Copy link

Our specs have started to fail too:

      Selenium::WebDriver::Error::SessionNotCreatedError:
        session not created: This version of ChromeDriver only supports Chrome version 74
          (Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Linux 4.15.0-1026-gcp x86_64)

@starsirius
Copy link
Author

Updating Chromedriver to 73.0.3683.68 didn't resolve the issue. Still getting the same error. Looks like people have reported similar incompatibility issue.

Selenium::WebDriver::Error::WebDriverError:
  chrome not reachable
    (Session info: headless chrome=73.0.3683.75)
    (Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Linux 4.10.0-35-generic x86_64)

@ioquatix
Copy link

We temporarily worked around this issue by manually installing the right version:

In .travis.yaml

before_script:
  - bundle exec chromedriver-update 2.46

@kichion
Copy link

kichion commented Mar 13, 2019

Our specs have started to fail. An example of a solution with CircleCI:

    - run:
        name: Install Fixed Version ChromeDriver
        command: |
          rm -rf $HOME/.chromedriver-helper
          bundle exec chromedriver-update 73.0.3683.68

@moro
Copy link

moro commented Mar 13, 2019

Hi. (This is an off-topic from the issue title, but may help someone.)

We got similar test failure on our tests and found a solution for us.

We have options.add_argument('--disable-dev-shm-usage') option in our spec helper once we set up our system spec, which runs on Docker on CircleCI.

Then I found
https://github.com/SeleniumHQ/docker-selenium#running-the-images today

This is a known workaround to avoid the browser crashing inside a docker container, here are the documented issues for Chrome and Firefox.

So I dropped the option, then our tests success 🎉
If your config has same option, try it on.

Thanks.

@longwave
Copy link

longwave commented Mar 13, 2019

Thanks to the above posters I am now using the following script to detect the version of Chrome and install the correct version of Chromedriver, this should follow the official version selection algorithm:

CHROME_VERSION=$(google-chrome --version | sed -r 's/[^0-9]+([0-9]+\.[0-9]+\.[0-9]+).*/\1/g')
CHROMEDRIVER_VERSION=$(curl -s https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_VERSION)
bundle exec chromedriver-update $CHROMEDRIVER_VERSION

@nshki
Copy link

nshki commented Mar 13, 2019

@moro This fixed the issue for us as well, thanks so much!

@michaelcarter
Copy link

michaelcarter commented Mar 13, 2019

On Codeship, I was getting a This version of ChromeDriver only supports Chrome version 74 error, fixed for me by adding the following to my build steps:

export CHROMEDRIVER_VERSION=73.0.3683.68
\curl -sSL https://raw.githubusercontent.com/codeship/scripts/master/packages/chromedriver.sh | bash -s
bundle exec chromedriver-update $CHROMEDRIVER_VERSION

@seanlinsley
Copy link

seanlinsley commented Mar 14, 2019

Here's a script that finds the right version of Chromedriver for the version of Chrome installed locally: https://gist.github.com/seanlinsley/36a204862f08942b0667e941331f3a75. It works both on Ubuntu and MacOS.

I would open a PR for this gem, but it's not clear to me why GoogleCodeParser is using Gem::Version for comparisons. Is there some extra history to this logic?

def newest_download_version
@newest_download_version ||= downloads.map { |download| version_of(download) }.max
end

def version_of url
Gem::Version.new grab_version_string_from(url)
end

There's also the question of whether downloads (which does XML parsing) is still needed, or if it could rely on the LATEST_RELEASE_#{version} API instead.

@connorshea
Copy link

@seanlinsley do you have a fork we can use to test this with?

@seanlinsley
Copy link

I don't have a fork at the moment, but you can copy that code into your project to test (I put it in spec/support/chromedriver.rb)

@flavorjones
Copy link
Owner

A PR would be very welcome here, I don't know that I'll have the opportunity to look into this before the weekend.

@flavorjones
Copy link
Owner

@seanlinsley you asked

I would open a PR for this gem, but it's not clear to me why GoogleCodeParser is using Gem::Version for comparisons. Is there some extra history to this logic?

Yes, Gem::Version is an object that implements #<=> to sort version strings as you'd expect (as opposed to lexicographical sort), so we can, for example, call #max on an Array and get the latest version. So it seems like it's not needed in your gist.

@flavorjones
Copy link
Owner

I'd also like to point everyone at #78 in which I point out some risks around an implementation like the one suggested by @seanlinsley, mainly, that the name and location of the chrome/chromium binary may not be obvious to find and may therefore be problematic in and of itself.

@bransynluther
Copy link

We temporarily worked around this issue by manually installing the right version:

In .travis.yaml

before_script:
  - bundle exec chromedriver-update 2.46

We are using codeship to run our builds, and this answer fixed our problem for Ruby on Rails.
ioquatix, thank you.

@flavorjones
Copy link
Owner

I'm going to close this issue, as the gem is being deprecated in favor of webdrivers, see #83.

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

No branches or pull requests