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

Support for Heroku 16 #13

Open
jjalan opened this issue Jul 13, 2018 · 1 comment
Open

Support for Heroku 16 #13

jjalan opened this issue Jul 13, 2018 · 1 comment

Comments

@jjalan
Copy link

jjalan commented Jul 13, 2018

I recently used this build pack to generate PDF file using unoconv on Heroku 16. I am documenting my finding and issue so in case other folks are running into similar issue and can help out.

  1. Out of the box, after libreoffice is installed, when I ran unoconv, it threw an error saying office installation is not found. To fix it, I had to set UNO_PATH in compile file at the bottom
# Set UNO_PATH so unoconv can search for libreoffice
echo 'export UNO_PATH="$HOME/vendor/libreoffice"' >> $PROFILE_PATH
  1. After that, unoconv complained as follows:
error: "Traceback (most recent call last): File "/app/unoconv", line 810, in connect unocontext = resolver.resolve("uno:%s" % op.connection) uno.NoConnectException: Connector : couldn't connect to socket (Success) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/app/unoconv", line 1392, in <module> main() File "/app/unoconv", line 1306, in main convertor = Convertor() File "/app/unoconv", line 789, in __init__ unocontext = self.connect(resolver) File "/app/unoconv", line 821, in connect product = self.svcmgr.createInstance("com.sun.star.configuration.ConfigurationProvider").createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", UnoProps(nodepath="/org.openoffice.Setup/Product")) __main__.CannotActivateFactoryException: loading component library <file:///app/vendor/libreoffice/program/../program/libmergedlo.so> failed "
  1. I ran ldd libmergedlo.so. It said three shared libraries are missing - libGL, libSM, libICE. We are running on heroku 16. After reading https://devcenter.heroku.com/articles/stack-packages, it seems Heroku removes corresponding libraries from runtime which explains the issue. So I used https://elements.heroku.com/buildpacks/heroku/heroku-buildpack-apt as well with Aptfile as
libice-dev
libice6
libsm-dev
libsm6

This fixed the issue complaining that libSM, libICE shared libraries are missing. However, it is still looking for libGL.so.1 (which is 32 bit version I believe).

I am stuck here. I tried various thing such as trying to instruct apt buildpack to download 32 bit version of libGL or creating a link of libGL.so.1 to libGL.so.8 (under /app/vendor/libreoffice/program) but both approach failed and running ldd libmergedlo.so still complains that libGL.so.1 is missing.

Any help would be greatly appreciated.

@AlejandroFuster
Copy link

AlejandroFuster commented Aug 20, 2018

Hello @jjalan!

Got the same problem, and I solved it the following way:

  1. Used https://elements.heroku.com/buildpacks/heroku/heroku-buildpack-apt from the beggining with the following Aptfile:
libreoffice
libxfixes3
libxinerama-dev
libxinerama1
libxdamage1
libglu1-mesa:i386

(libreoffice asked me for other libraries after step 2, that's why those extra dependencies are there)

  1. Ran the following command (to create a link):
    ln -s ~/.apt/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 ~/.apt/usr/lib/x86_64-linux-gnu/

And it worked!

I didn't use unoconv, but I really hope you can solve it with these steps!

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

2 participants