Code Monkey home page Code Monkey logo

Comments (31)

jabrown85 avatar jabrown85 commented on June 15, 2024 1

Our stack images are here. I went and compared the ones that are dev-only that used to be in the heroku-16 stack. I got it working by installing all of the ones that used to be in the heroku-16 runtime stack. Some are likely not required, but this can get you through while we update our stack image.

fontconfig
libcairo2
libcroco3
libdatrie1
libdjvulibre-text
libdjvulibre21
libgdk-pixbuf2.0-0
libgdk-pixbuf2.0-common
libglib2.0-data
libgraphite2-3
libharfbuzz0b
libilmbase12
libkmod2
libnetpbm10
libopenexr22
libpango-1.0-0
libpangocairo-1.0-0
libpangoft2-1.0-0
libpixman-1-0
librsvg2-2
librsvg2-common
libthai-data
libthai0
libwmf0.2-7
libxcb-render0
libxrender1

from heroku-buildpack-google-chrome.

jabrown85 avatar jabrown85 commented on June 15, 2024 1

@nicolasmlv you can see here we pass the remote-debugging option normally. Seems to have been a change behavior with the print-to-pdf option you need based on the error message and you are omitting it in your execution. You can also use $GOOGLE_CHROME_BIN that the buildpack sets instead of coding that path.

@mjsommer - Heroku-18 is working for CI use. If you've tried clearing cache and it's still not working, can you post a bit about your setup?

If you are using this buildpack in a production app you'll need to use the apt buildpack and the list of packages above.

from heroku-buildpack-google-chrome.

jabrown85 avatar jabrown85 commented on June 15, 2024

I think this should be resolved now. Please let me know otherwise! Sorry for the trouble.

from heroku-buildpack-google-chrome.

tmcw avatar tmcw commented on June 15, 2024

I can confirm that I'm seeing the same error today when trying to update a stack to heroku-18.

from heroku-buildpack-google-chrome.

jabrown85 avatar jabrown85 commented on June 15, 2024

Can you try clearing your cache @tmcw ?

heroku ci:run -p <pipeline> --no-cache

or use the dashboard ui dropdown and select Run without cache

from heroku-buildpack-google-chrome.

nicolasmlv avatar nicolasmlv commented on June 15, 2024

I use this buildpack for generating pdf from HTML on a Heroku worker dyno, I don't use pipeline, so I am not sure what is heroku ci:run --no-cache does

I am on Heroku-18, I tried heroku repo:purge_cache

but I still have :
heroku run bash
$ google-chrome
/app/.apt/opt/google/chrome/chrome: error while loading shared libraries: libXrender.so.1: cannot open shared object file: No such file or directory

from heroku-buildpack-google-chrome.

jabrown85 avatar jabrown85 commented on June 15, 2024

@nicolasmlv can you try using this plugin and it's cache clearing method?

https://github.com/heroku/heroku-builds

heroku builds:cache:purge -a example-app

from heroku-buildpack-google-chrome.

nicolasmlv avatar nicolasmlv commented on June 15, 2024

@jabrown85 I installed it and I ran heroku builds:cache:purge -a myapp and then I git push

and then it is still not working

~ $ google-chrome
/app/.apt/opt/google/chrome/chrome: error while loading shared libraries: libXrender.so.1: cannot open shared object file: No such file or directory
~ $

from heroku-buildpack-google-chrome.

jabrown85 avatar jabrown85 commented on June 15, 2024

@nicolasmlv I just looked at https://devcenter.heroku.com/articles/stack-packages and realized the libxrender1 package is only available at build time on heroku-18. It's been reported to the build team and they'll add it in the future. In the meantime, you can either fork this buildpack and add it to the apt-get packages it installs or use https://github.com/heroku/heroku-buildpack-apt to install libxrender1.

from heroku-buildpack-google-chrome.

nicolasmlv avatar nicolasmlv commented on June 15, 2024

@jabrown85

ok now a different error :

/app/.apt/opt/google/chrome/chrome: error while loading shared libraries: libpangocairo-1.0.so.0: cannot open shared object file: No such file or directory

I tried to add also libpangocairo in my Aptfile, but same error 😢

If I succeed I may add a Pull Request documenting this if those libs are not in Heroku-18

from heroku-buildpack-google-chrome.

jabrown85 avatar jabrown85 commented on June 15, 2024

It might also need these:

libpango-1.0-0
libpangocairo-1.0-0
libpangoft2-1.0-0

from heroku-buildpack-google-chrome.

nicolasmlv avatar nicolasmlv commented on June 15, 2024

/app/.apt/opt/google/chrome/chrome: error while loading shared libraries: libcairo.so.2: cannot open shared object file: No such file or directory

Then I added libcairo2

/app/.apt/opt/google/chrome/chrome: error while loading shared libraries: libgdk_pixbuf-2.0.so.0: cannot open shared object file: No such file or directory and I don't know what is the apt package for this one

Maybe there is a full list of the apt package somewhere?

from heroku-buildpack-google-chrome.

nicolasmlv avatar nicolasmlv commented on June 15, 2024

google-chrome is working now thanks, but i can't user --print-to-pdf

But when I run :

google-chrome --headless --disable-gpu --print-to-pdf=pdflocalpath "https://url"

I get an error :

[0918/182113.951455:ERROR:headless_shell.cc(577)] Print to PDF is disabled when remote debugging is enabled.

It was working on heroku-16 🤔

from heroku-buildpack-google-chrome.

jabrown85 avatar jabrown85 commented on June 15, 2024

Does it still work on heroku-16? It seems like that is a chrome behavior changed based on the error message.

from heroku-buildpack-google-chrome.

mjsommer avatar mjsommer commented on June 15, 2024

Can someone please verify that headless Chrome actually works on Heroku's Stack 18? I have been working through a number of issues, with this being my most recent error message:

Selenium::WebDriver::Error::UnknownError (unknown error: Chrome failed to start: exited abnormally
(chrome not reachable)
(The process started from chrome location /app/.apt/usr/bin/google-chrome-stable is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

I am using these two buildpacks:
https://github.com/heroku/heroku-buildpack-chromedriver
https://github.com/heroku/heroku-buildpack-google-chrome

from heroku-buildpack-google-chrome.

merwok avatar merwok commented on June 15, 2024

Putting this here in case in helps some people:
I tried installing the big list of packages above using the APT buildpack and it worked for my use case, which is not long-running debugging port interface but one-shot sub-process with --headless --print-to-pdf.

The executable installed in /app/.apt/usr/bin is a wrapper script that checks a bunch of things before trying to run /usr/lib/chromium-browser/chromium-browser, so I used /app/.apt/usr/lib/chromium-browser/chromium-browser directly, and added the --no-sandbox flag to avoid errors related to the heroku environment.

from heroku-buildpack-google-chrome.

nicolasmlv avatar nicolasmlv commented on June 15, 2024

@merwok thank you this helped me, it is not exactly the same thing for me :

which google-chrome
-> /app/.apt/usr/bin/google-chrome
cat /app/.apt/usr/bin/google-chrome
-> exec $HOME/.apt/opt/google/chrome/chrome --headless --no-sandbox --disable-gpu --remote-debugging-port=9222 $@
$HOME
-> /app

So now I use :

/app/.apt/opt/google/chrome/chrome --headless --no-sandbox --print-to-pdf="/tmp/pdf.pdf" "https://myurl"

and it WORKS

@jabrown85 I don't know, it was still working 10 days ago before my purging cache builds:cache:purge etc.. on Heroku-16, didn't retry on Heroku-16

from heroku-buildpack-google-chrome.

mjsommer avatar mjsommer commented on June 15, 2024

@jabrown85 - Thanks for your help, and verifying Stack 18. My Heroku based Rails app is now failing to respond with an error at=error code=H14 desc="No web processes running ...".

Here is what I have, and what I did:
Stack 18
Ruby 2.4.4p296
Rails 4.2.10
BuildPacks:
heroku/ruby
https://github.com/heroku/heroku-buildpack-chromedriver
https://github.com/heroku/heroku-buildpack-google-chrome
https://github.com/heroku/heroku-buildpack-apt

APTfile (in application root directory)
fontconfig
libcairo2
libcroco3
libdatrie1
libdjvulibre-text
libdjvulibre21
libgdk-pixbuf2.0-0
libgdk-pixbuf2.0-common
libglib2.0-data
libgraphite2-3
libharfbuzz0b
libilmbase12
libkmod2
libnetpbm10
libopenexr22
libpango-1.0-0
libpangocairo-1.0-0
libpangoft2-1.0-0
libpixman-1-0
librsvg2-2
librsvg2-common
libthai-data
libthai0
libwmf0.2-7
libxcb-render0
libxrender1

In addition, I cleared the cache using heroku builds:cache:purge.

Any suggestions?

from heroku-buildpack-google-chrome.

jabrown85 avatar jabrown85 commented on June 15, 2024

from heroku-buildpack-google-chrome.

mjsommer avatar mjsommer commented on June 15, 2024

Right, but heroku ps:scale web=1 is giving me a Scaling dynos... ! ... Couldn't find that process type.

The build log states:
Build started by user ...
Deploy sadfasdf by user ...
Release v110 created by user ...
Build succeeded

from heroku-buildpack-google-chrome.

mjsommer avatar mjsommer commented on June 15, 2024

@jabrown85 - I forgot to answer your question. I am using this in a 'production app', not in testing.

from heroku-buildpack-google-chrome.

jabrown85 avatar jabrown85 commented on June 15, 2024

What does your Procfile look like?

from heroku-buildpack-google-chrome.

mjsommer avatar mjsommer commented on June 15, 2024

I do not have one ... Should I?

from heroku-buildpack-google-chrome.

mjsommer avatar mjsommer commented on June 15, 2024

@jabrown85 - I rolled back the Stack to 16, removed the apt Buildpack, and deleted the APTfile. My Rails app now comes up again, but I am receiving the following error.

Completed 500 Internal Server Error in 6689ms (ActiveRecord: 13.7ms)
Selenium::WebDriver::Error::WebDriverError (chrome not reachable
(Session info: headless chrome=69.0.3497.100)
(Driver info: chromedriver=2.42.591071 (0b123ff80972cc1a65a789643186d2ae582cd4ac),platform=Linux 4.4.0-1027-aws x86_64)):

The code I am calling, is basically:
Capybara.current_session.visit(url)
Capybara.current_session.find('#some_element')

It bombs at this point ... Fyi, the same code works perfectly on Mac OSX.

from heroku-buildpack-google-chrome.

jamintz avatar jamintz commented on June 15, 2024

Has this issue been reliably solved? I'm using:

  • Heroku-18
  • ruby 2.4.4
  • rails 4.2.10

Starting a new browser with:
options = Selenium::WebDriver::Chrome::Options.new
chrome_bin = ENV.fetch('GOOGLE_CHROME_SHIM') #/app/.apt/usr/bin/google-chrome-stable
options.add_argument "no-sandbox"
options.add_argument "window-size=1500x800"
options.add_argument('--dns-prefetch-disable')
options.add_argument "headless"
options.add_argument "disable-gpu"
options.add_argument('--disable-dev-shm-usage')

This works fine locally but running on Heroku I'm getting:
Selenium::WebDriver::Error::UnknownError: unknown error: Chrome failed to start: exited abnormally
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /app/.apt/usr/bin/google-chrome-stable is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

Any suggestions?

from heroku-buildpack-google-chrome.

jabrown85 avatar jabrown85 commented on June 15, 2024

Has this issue been reliably solved? I'm using:

It is only solved for heroku-18 stack with the Apt buildpack as mentioned above. That will be the case until after the updated stack image is rolled out to production. This will be at least a week or so from now.

from heroku-buildpack-google-chrome.

mjsommer avatar mjsommer commented on June 15, 2024

It is only solved for heroku-18 stack

So @jabrown85, does this mean that Stack-16 is completely out? As mentioned above, my app would not even start in Stack-18, so I rolled back to Stack-16.

from heroku-buildpack-google-chrome.

jabrown85 avatar jabrown85 commented on June 15, 2024

heroku-16 is confirmed to be working. Maybe you can post some of your capybara setup.

from heroku-buildpack-google-chrome.

mjsommer avatar mjsommer commented on June 15, 2024

Thanks @jabrown85, #63. Chrome not reachable outlines my Stack 16 setup. I am impartial on whether we use 16 or 18, I just would like to see it work.

from heroku-buildpack-google-chrome.

mjsommer avatar mjsommer commented on June 15, 2024

I'm good, ref: Chrome not reachable #63.

from heroku-buildpack-google-chrome.

edmorley avatar edmorley commented on June 15, 2024

The stack image update (heroku/base-images/pull/116) that added the missing dependencies was rolled out back in September, so this should be fixed now. If there's anything not working, please could you file a new issue with steps to reproduce. Many thanks :-)

from heroku-buildpack-google-chrome.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.