Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
i386 opened this issue Aug 27, 2020 · 3 comments
Open

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

i386 opened this issue Aug 27, 2020 · 3 comments

Comments

@i386
Copy link

i386 commented Aug 27, 2020

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 i386 changed the title chromium-chromedriver is installed and on path before heroku-buildpack-chromedriver Buildpack installs chromium-chromedriver when it shouldn't Aug 27, 2020
@moveson
Copy link

moveson commented Aug 28, 2020

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
Copy link

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

@i386
Copy link
Author

i386 commented Jun 21, 2021

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.

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

No branches or pull requests

3 participants