heroku-buildpack-google-chrome icon indicating copy to clipboard operation
heroku-buildpack-google-chrome copied to clipboard

Buildpack installs chromium-chromedriver when it shouldn't

Open i386 opened this issue 4 years ago • 3 comments

My horrible scraping solution broke today because chrome driver got out of sync with chrome. I use heroku-buildpack-chromedriver which is run after heroku-buildpack-google-chrome

During investigation, it turns out that there are two chromedrivers installed - one in ~/.apt and another in ~/.chromedriver

Looks like heroku-buildpack-google-chrome is dragging in chromium-chromedriver somehow:

remote: W: --force-yes is deprecated, use one of the options starting with --allow instead.
remote: -----> Fetching https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
remote: -----> Installing adwaita-icon-theme_3.28.0-1ubuntu1_all.deb
remote: -----> Installing at-spi2-core_2.28.0-1_amd64.deb
remote: -----> Installing chromium-browser_83.0.4103.61-0ubuntu0.18.04.1_amd64.deb
remote: -----> Installing chromium-browser-l10n_83.0.4103.61-0ubuntu0.18.04.1_all.deb
remote: -----> Installing chromium-chromedriver_83.0.4103.61-0ubuntu0.18.04.1_amd64.deb
remote: -----> Installing chromium-codecs-ffmpeg-extra_83.0.4103.61-0ubuntu0.18.04.1_amd64.deb

According to the README this build pack shouldn't be doing that

To use Selenium with this buildpack, you'll also need Chrome's webdriver. This buildpack does not install chromedriver, but there is a chromedriver buildpack also available.

i386 avatar Aug 27 '20 00:08 i386

I'm having the same issue. My Heroku CI pipeline broke as a result of this problem. The failure I'm seeing is this:

            Selenium::WebDriver::Error::SessionNotCreatedError:
              session not created: This version of ChromeDriver only supports Chrome version 85

My app.json file looks like this:

{
  "environments": {
    "test": {
      "addons": ["heroku-postgresql:in-dyno", "heroku-redis:in-dyno"],
      "buildpacks": [
        { "url": "heroku/ruby" },
        { "url": "https://github.com/heroku/heroku-buildpack-chromedriver" },
        { "url": "https://github.com/heroku/heroku-buildpack-google-chrome" }
      ],
      "formation": {
        "test": {
          "quantity": 1,
          "size": "performance-l"
        }
      },
      "scripts": {
        "test-setup": "rails db:structure:load; bin/rails assets:precompile",
        "test": "bin/rspec"
      }
    }
  }
}

But I've also tried removing the chromedriver buildpack and that fails with the following message:

            Selenium::WebDriver::Error::WebDriverError:
              Unable to find chromedriver. Please download the server from
              https://chromedriver.storage.googleapis.com/index.html and place it somewhere on your PATH.

moveson avatar Aug 28 '20 21:08 moveson

Clearing my build cache fixed this issue for me. Instructions here.

matthewmoss avatar Sep 02 '20 17:09 matthewmoss

These build packs are a production nightmare. No combination of environment variables will have you a working chrome + chrome driver configuration that won't break the moment a chrome version moves between channels.

i386 avatar Jun 21 '21 23:06 i386