pyronlaboratory / heroku-integrated-firefox-geckodriver

Buildpack enables your client code to access Firefox along with Geckodriver in a Heroku slug.
https://pyronlaboratory.github.io/heroku-integrated-firefox-geckodriver/
MIT License
41 stars 81 forks source link

Differences in Heroku behavior #8

Closed arsandov closed 3 years ago

arsandov commented 4 years ago

I'm trying to deploy a new staging environment with the buildpack. However, it is not working as throws error "Selenium::WebDriver::Error::UnknownError (invalid argument: can't kill an exited process)", despite I have the same configuration on both heroku machines. They have the same Firefox, Ubuntu and Geckodriver version.

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.4 LTS
Release:    18.04
Codename:   bionic

Looking at the build log, I noticed some differences in the libraries installed (see here highlighted differences). Why are they not installing the same libraries? How can we be sure to install correctly all of them?

github-actions[bot] commented 4 years ago

Thank you for using heroku-integrated-firefox-geckodriver. Preliminary examination of your issue is underway' first issue

arsandov commented 4 years ago

I was able to fix the problem installing a buildpack heroku buildpacks:add --index 1 heroku-community/apt and creating an Aptfile that include the following libraries libappindicator1 libasound2 libatk1.0-0 libatk-bridge2.0-0 libcairo-gobject2 libgconf-2-4 libgtk-3-0 libice6 libnspr4 libnss3 libsm6 libx11-xcb1 libxcomposite1 libxcursor1 libxdamage1 libxfixes3 libxi6 libxinerama1 libxrandr2 libxss1 libxt6 libxtst6 fonts-liberation I'm not sure if this should be included in the buildpack or documentation too, but this buildpack doesn't install Firefox dependencies, so be aware of that

RishiHQ commented 4 years ago

HI @arsandov, I'm running into the same error, and I was hoping to confirm whether it was the same issue you had.

In your highlighted differences, is the left side your original production environment, and the right side your new staging environment?

Appreciate if you're able to confirm :)

arsandov commented 4 years ago

Hey @RishiHQ! I'm happy to help you. Actually, left side is set as production. The solution used to install the buildpack was the same than above. However, at the moment I wrote this issue we didn't notice that because it was one out dozens things we tried on production until it worked, and even after removing the "heroku-community/apt" buildpack and the "Aptfile", new deployments with "heroku-integrated-firefox-geckodriver" (left side) kept installing these dependencies without our knowledge.

arsandov commented 4 years ago

@RishiHQ I will update my answer. We set a new environment and again faced the same issues, now I found the source of the problem, this buildpack doesn't install Firefox dependencies, I noticed that looking at this other buildpack https://github.com/thopd88/heroku-buildpack-firefox/blob/master/bin/compile#L59 so, adding the complete list of dependencies in the Aptfile that is used by heroku buildpacks:add --index 1 heroku-community/apt fixed the issue. Here is the list of dependencies I added: libappindicator1 libasound2 libatk1.0-0 libatk-bridge2.0-0 libcairo-gobject2 libgconf-2-4 libgtk-3-0 libice6 libnspr4 libnss3 libsm6 libx11-xcb1 libxcomposite1 libxcursor1 libxdamage1 libxfixes3 libxi6 libxinerama1 libxrandr2 libxss1 libxt6 libxtst6 fonts-liberation

RishiHQ commented 4 years ago

Hi @arsandov,

I would like to thank you from the bottom of my heart. For some reason, I lost this thread, but on re-discovering it (with on and off debugging for 2 months), I have gotten this to work!

Thank you so much!

pyronlaboratory commented 3 years ago

@arsandov thanks for posting the issue. The latest compile includes the relevant libraries needed. You can avoid installing multiple buildpacks and keep your heroku slug size to a minimum.