heroku/heroku-buildpack-chromedriver

Version lookup instructions changed

tennety opened this issue ยท 21 comments

https://sites.google.com/a/chromium.org/chromedriver/downloads/version-selection
This page seems to indicate that looking up LATEST_RELEASE isn't accurate anymore, we need to look it up by the specific version of Chrome we're running against. I'm happy to make a PR. Does the heroku chrome buildpack set a version env var for the downloaded browser?

Can confirm that something changed. I'm using it in heroku CI, and when I use it I'm currently getting 74.0.3729.6 which looks like it's in beta.

I started getting the error

Selenium::WebDriver::Error::SessionNotCreatedError:         Selenium::WebDriver::Error::SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 74
          (Driver info: chromedriver=74.0.3729.6

@splybon yep, that's the exact error we were getting. I ended up removing the buildpack and falling back to using https://github.com/flavorjones/chromedriver-helper since we also use Capybara/Selenium. It seems like the version of Chrome installed by https://github.com/heroku/heroku-buildpack-google-chrome is too old for the chromedriver installed by this buildpack.

We're also getting this error which is failing our Heroku CI builds.

Does anyone have any updates or workarounds for this?

I can confirm that the buildpack is using v74.0.3729.6 of the chromedriver, which is the beta release instead of the stable release. This fails because the stable release of Chrome is v73.

Like @tennety, I was able to get my builds to pass after removing this buildpack and explicitly passing the stable version to https://github.com/flavorjones/chromedriver-helper.

I suspect one can achieve the same thing by setting CHROMEDRIVER_VERSION with this buildpack, but I was not able to test that.

@rubendinho Yes, setting CHROMEDRIVER_VERSION to the latest beta version should get this working if you are not using the stable release of Chrome.

I set CHROMEDRIVER_VERSION and it doesn't seem to be taking. I've tried lots of versions but in my last attempt Heroku is reporting: CHROMEDRIVER_VERSION: 72.0.3626.69. I deploy and the Heroku build log shows:

remote: -----> chromedriver app detected
remote: -----> Downloading chromedriver v72.0.3626.69...

Then in the console:

> ENV['CHROMEDRIVER_VERSION']
=> "72.0.3626.69"
> run_importer_script
=> 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.4.0-1038-aws x86_64)

What am I doing wrong here? Why is it still using 74 even though I just watched it build 72?

@glennfu I have this same problem. I have set CHROMEDRIVER_VERSION: 72.0.3626.69 in the environment, watched the build download that version but still getting the error:

/app/vendor/bundle/ruby/2.3.0/gems/selenium-webdriver-3.14.0/lib/selenium/webdriver/remote/response.rb:69:in `assert_ok': session not created: This version of ChromeDriver only sup
ports Chrome version 74 (Selenium::WebDriver::Error::SessionNotCreatedError)
  (Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Linux 4.4.0-1038-aws x86_64)

Please let me know if you found a solution for this. Thanks

In my case, I had both the buildpack and the chromedriver ruby gem. The ENV variable is setting the version for the buildpack, but the test suite was using the bundled chromedriver.

I removed the buildpack and am using only the gem setting the version per the gem docs.

heroku buildpacks:remove heroku/chromedriver -r production
bundle update chromedriver-helper

That completely solved my problem. Thanks @rubendinho

Thank guys. Works for me too. I was using it for watir web crawling. Just changed to using the gem instead.

I've run into this recently and stumbled upon this issue. It's happening now because Chrome 78 has been released but the stable download is still on 77 and the chrome driver version is 78.

Manually setting the chromedriver version var to 77 works for now but it looks like this will keep happening so maybe we need a chromium buildpack using Ubuntu's deb files:
http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/

Found a workaround that avoids this hassle

  1. Use https://github.com/heroku/heroku-buildpack-apt to install chromium instead
  2. Create Aptfile with
libcairo-gobject2
chromium-browser
chromium-chromedriver
  1. I'm using Python, but this should be portable to whatever
# Headless mode
opts = webdriver.ChromeOptions()
if not debug:
    opts.add_argument('--headless')
    opts.add_argument('--disable-gpu')
    opts.add_argument('--no-sandbox')
    opts.add_argument('--disable-dev-shm-usage')
    opts.binary_location = shutil.which('chromium-browser').replace('/bin/', '/lib/chromium-browser/', 1)
driver = webdriver.Chrome(options=opts)

The shutil replace is needed because the launcher script chromium-browser in /app/.apt/usr/bin/ expects to find a chromium-browser in /usr/lib when it will be in /app/.apt/usr/lib

Hi is there a way to run the chrome browser in non headless mode

Maybe you could use vncserver over port 443/80 and run chrome as the sole thing in the X11 session.

@sameer can we define version also in "Aptfile", like what I've to do if I want chromium-browser version 81?

Can any one tell me how to set version for this chrome driver ,I cant able to do it my self ,i tried a lot things

You can control the version of Chromedriver following: https://github.com/heroku/heroku-buildpack-chromedriver#configuring-the-downloaded-version-of-chromedriver
That will not be the actual version of Chrome itself which is an entirely separate buildpack.

@sameer can we define version also in "Aptfile", like what I've to do if I want chromium-browser version 81?

Sorry, I just saw this. Unfortunately I don't think this is possible. It's just the latest version of Chrome on the specified channel https://github.com/heroku/heroku-buildpack-google-chrome

Closing stale issues. If the issue persists with the latest version of the buildpack please open a new issue with a minimal reproducable example (but also bear in mind that this buildpack is not an officially supported buildpack, so unless there is an actual bug with the buildpack, application debugging issues are generally out of scope).