heroku / heroku-buildpack-google-chrome

[DEPRECATED] Classic buildpack that installs Google Chrome.
296 stars 365 forks source link

Buildpack installs chromium-chromedriver when it shouldn't #94

Open i386 opened 4 years ago

i386 commented 4 years ago

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.

moveson commented 4 years ago

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.
matthewmoss commented 4 years ago

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

i386 commented 3 years ago

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.