FS#43683 - [wkhtmltopdf] wkhtmltopdf on Heroku cannot find libwkhtmltox.so.0

Attached to Project: Community Packages
Opened by Matt Stevens (Matt--) - Tuesday, 03 February 2015, 00:13 GMT
Last edited by Doug Newgard (Scimmia) - Tuesday, 03 February 2015, 07:17 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To No-one
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Greetings,

It has been suggested that the following may be a bug related the Arch wkhtmltopdf package.

Forum for wicked-pdf and the topic I started there.
https://groups.google.com/forum/#!topic/wkhtmltopdf-general/vyUF_pbduOI

I have just cut n pasted the bug report here and added the comment from the wicked-pdf forum to the end.

Regards
Matt

--//--
I have installed wicked_pdf locally to my Rails app and it is generating pdfs.

When I push it to Heroku and try to generate a pdf, I get:

Command Error: /app/bin/wkhtmltopdf: error while loading shared libraries: libwkhtmltox.so.0: cannot open shared object file: no such file or directory

I am running Arch. wkhtmltopdf was installed using pacman and generated entries in the /usr/bin/wkhtmltopdf and /usr/lib64/libwkhtmltox.so.0

wkhtmltopdf is copied to my_rails_app/bin/wkhtmltopdf and Heroku appears to find it ok.

libwkhtmltox.so.0 has been copied to three locations and Heroku still cannot find it.
my_rails_app/bin/libwkhtmltox.so.0
my_rails_app/lib/libwkhtmltox.so.0
my_rails_app/lib64/libwkhtmltox.so.0

Where does Heroku want this file?

-- EDIT --

The test "wkhtmltopdf http://www.google.com google.pdf" performs as expected on my local machine (it generates a pdf file).

Using "heroku run bash" brings up a command line connected to my heroku server;
% which wkhtmltopdf
=> /app/bin/wkhtmltopdf

% which libwkhtmltox.so.0
=> /app/bin/libwkhtmltox.so.0

% wkhtmltopdf http://www.google.com google.pdf
=> wkhtmltopdf: error while loading shared libraries: libwkhtmltox.so.0: cannot open shared object file: No such file or directory

--//--
(from the wicked-pdf forum)
If it was installed by your package manager, please contact the
packager for any issues in the package. Also, it is highly likely that
it would not be using the patched Qt, which would disable a lot of
features.
This task depends upon

Closed by  Doug Newgard (Scimmia)
Tuesday, 03 February 2015, 07:17 GMT
Reason for closing:  Not a bug
Comment by Doug Newgard (Scimmia) - Tuesday, 03 February 2015, 03:13 GMT
Did you just copy the symlink instead of the actual library? And the "If it was installed by your package manager" part doesn't apply since you seem to be copying files to different locations. It is then not installed by the package manager now.
Comment by Matt Stevens (Matt--) - Tuesday, 03 February 2015, 05:17 GMT
It was failing before I moved the libwkhtmltos.so.0 file. Moving it was in response to the error message I was getting.

As to the move itself, I used bash's mv command, which appeared to be successful and then copied it using the bash cp command into two more locations, attempting to satisfy the error message. I haven't come across symlinks before, if the package is using symlinks then yes I would have been moving symlinks.
Comment by Doug Newgard (Scimmia) - Tuesday, 03 February 2015, 05:42 GMT
Symlinks are an important part of any Linux/Unix system. To be honest, I a bit shocked that you're doing any kind of development on Arch and have never come across symlinks. Hell, I'm shocked that you've installed Arch at all and have never come across symlinks.

As for the rest, you've made a bit of a mess now. Reinstall the wkhtmltopdf package, get rid of the now broken symlinks you copied, and start fresh. Really, this seems to be more of an issue with setting up heroku than with the package at all.
Comment by Doug Newgard (Scimmia) - Tuesday, 03 February 2015, 07:16 GMT
OK, looking into this a bit more, Heroku uses containers. You need to install wkhtmltopdf inside that container. This is completely outside the scope of an Arch package, so I'm closing this.

Loading...