heroku/heroku-buildpack-google-chrome

Chrome version 116; Chrome Driver expecting version 114

jonathanrstern opened this issue ยท 14 comments

I know this has come up many times here.

Is there an accepted solution?

I'm thinking about using https://github.com/awl19/heroku-buildpack-google-chrome. @awl19

I'm having the same problem. There's no way to choose what version of google-chrome to use in the heroku server?

awl19 commented

I don't think there's any accepted solution, but I would recommend my fork. It's using the latest version of this repo and it works on my projects as expected.

Look at this issue thread for some problems that were troubleshooted when trying to get it to work: #134

If your project is broken because the Chrome browser version is wrong then you have nothing to lose trying to make my repo work. You can always switch back to this repo.

awl19 commented

Awesome, glad to hear it!

I don't think there's any accepted solution, but I would recommend my fork. It's using the latest version of this repo and it works on my projects as expected.

Look at this issue thread for some problems that were troubleshooted when trying to get it to work: #134

If your project is broken because the Chrome browser version is wrong then you have nothing to lose trying to make my repo work. You can always switch back to this repo.

It also worked for me! Thank you! :)

Hey I just started getting an error because Chrome got updated to 116 compared to the expected 114 of the Driver.

I'm trying @awl19 's fork and getting this error:

dpkg-deb: error: '/tmp/codon/tmp/cache/apt/cache/archives/google-chrome-stable_114-1_amd64.deb' is not a Debian format archive
! Push rejected, failed to compile Google Chrome app.
! Push failed

Anyone know what this could be?

awl19 commented

@nphenley

I suspect the Google Chrome Driver version you chose is incorrect/invalid.

I assume for the CHROME_VERSION env var you used the value "114", which the repo then attempted to download this URL:
https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_114-1_amd64.deb
Which results in a 404 error when you load in browser because it's not a valid Chrome Driver version.

Use this URL to test your Google Chrome Driver binary, it's the URL I used in my repo:
https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_{{VERSION_NUMBER_HERE}}-1_amd64.deb

You can find the versions available here:
https://sites.google.com/chromium.org/driver/downloads?authuser=0

Then copy/paste the version into the placeholder I set in that URL above.

Let's say you wanted to use the latest 114, your URL should look like this:
https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_114.0.5735.90-1_amd64.deb

If your browser intiates download then that means the download is valid, then you can paste the version into the repo's "CHROME_VERSION" env var and it should work.

I'm having the same problem. There's no way to choose what version of google-chrome to use in the heroku server?

This PR may related with this issue, but the pull request seems it was created and not has been approved for more than 2 years.

Ruby gem selenium-webdriver accepts chromedriver version 116, but heroku buildpack chromedriver has not yet accepts version116, only 114.

I guess followings may solve this problem

  1. `heroku-buildpack-google-chrome' accepts to downgrade version
  2. 'heroku-buildpack-chromedriver` accepts version v116
  3. use folks of awl19

Pull requests for options 1, 2 has been already submitted , but seems not has been approved for 2 years.
I do not want to use 3 option because of maintainance resource. sorry.

Is there good way of not using heroku buildpacks? Now I am thinking of using heroku container to setup chrome and chromedriver instead.

I don't think there's any accepted solution, but I would recommend my fork. It's using the latest version of this repo and it works on my projects as expected.

Look at this issue thread for some problems that were troubleshooted when trying to get it to work: #134

If your project is broken because the Chrome browser version is wrong then you have nothing to lose trying to make my repo work. You can always switch back to this repo.

This worked for me as well! Thank you so much, really appreciate the effort!

You were right. However, I even once I had changed the version number it was still downloading other versions of Chrome, not just the one I had specified.

After doing some digging, I apparently had to purge the cache. Finally, that fixed it and I'm back up and running.

https://media.discordapp.net/attachments/1127020166811762779/1141764657376411769/image.png?width=849&height=599

Aaaaand now it's broken again. Looks like https://github.com/heroku/heroku-buildpack-chromedriver made an update.

Message: Unable to locate or obtain driver for chrome;

Purging cache and going back to Heroku buildpacks. Let's see what happens.

I think the bigger issue is keeping the chrome and driver version compatibility and hence both the build packs should be downloading it from https://googlechromelabs.github.io/chrome-for-testing

https://sites.google.com/chromium.org/driver/downloads/version-selection
This blog describes the changes required for M115 onwards

I updated selenium to the latest version (4.11.2) and now everything works again, even on Chrome 116

@awl19's fork was working for me for a long time then stopped. I found @jonathanrstern's suggestion helpful. After clearing the cache it stopped downloading both versions of chrome and only got 114 as i was specifying.

Since that suggestion points to some image that might not last forever here is what I did

heroku plugins:install heroku-builds
heroku builds:cache:purge
git commit --allow-empty -m "Purge cache"
git push heroku main

In the end i had to switch back to the heroku versions of the build pack because it seems like the newest chrome this build pack works for is 114, but the chrome driver build packs do not support chrome driver builds that old.

When i switched back fortunately things worked but I think the problem remains just as @prem911 says in his comment. This open issue has been the most useful resource for me dealing with this issue so thanks everyone for your input.