zakird / wkhtmltopdf_binary_gem

Ruby gem containing easily installable access to wkhtmltopdf application
https://rubygems.org/gems/wkhtmltopdf-binary
Apache License 2.0
184 stars 346 forks source link

support debian 12 bookworm (add new binaries) #162

Closed adamzapasnik closed 6 months ago

adamzapasnik commented 1 year ago

some of ruby docker images were upgraded from debian bullseye to bookworm a few days ago. This error has started to occur since then:

gems/wkhtmltopdf-binary-0.12.6.5/bin/wkhtmltopdf_debian_10_amd64: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory

Think we need new binaries for debian 12 something akin to https://github.com/zakird/wkhtmltopdf_binary_gem/pull/145

(My current workaround is to use bullseye images)

igorkasyanchuk commented 1 year ago

@adamzapasnik please tell me how you solved this issue for now? What did you put in the Gemfile?

adamzapasnik commented 1 year ago

@igorkasyanchuk I didn't modify a Gemfile. I updated docker images tags from: ruby:3.2 to ruby:3.2-bullseye. Does it answer your question?

igorkasyanchuk commented 1 year ago

thanks for reply, trying what you suggested 👍

bibstha commented 1 year ago

Bumping this. I also started getting this issue all of a sudden. I'm using registry.docker.com/library/ruby:3.1.4-slim image and no change in Dockerfile. Creating a symlink doesn't help. I tried the following but doesn't work.

# ln -sv /usr/lib/x86_64-linux-gnu/libssl.so /usr/lib/libssl.so.1.1
# ln -sv /usr/lib/x86_64-linux-gnu/libcrypt.so /usr/lib/libcrypto.so.1.1
# bundle exec /usr/local/bundle/ruby/3.1.0/bin/wkhtmltopdf
/usr/local/bundle/ruby/3.1.0/gems/wkhtmltopdf-binary-0.12.6.6/bin/wkhtmltopdf_debian_10_amd64: /lib/libssl.so.1.1: version `OPENSSL_1_1_0' not found (required by /usr/local/bundle/ruby/3.1.0/gems/wkhtmltopdf-binary-0.12.6.6/bin/wkhtmltopdf_debian_10_amd64)
/usr/local/bundle/ruby/3.1.0/gems/wkhtmltopdf-binary-0.12.6.6/bin/wkhtmltopdf_debian_10_amd64: /lib/libcrypto.so.1.1: version `OPENSSL_1_1_0' not found (required by /usr/local/bundle/ruby/3.1.0/gems/wkhtmltopdf-binary-0.12.6.6/bin/wkhtmltopdf_debian_10_amd64)
WhisperClaims commented 1 year ago

Same issue for us, fantastic blame pointing and solution suggesting from @igorkasyanchuk 🥳 we changed the base image from ruby-3.2.2 to ruby-3.2.2-bullseye

shubhamMishra112 commented 1 year ago

Same issue for us,

RuntimeError Failed to execute: ["/usr/local/bundle/bin/wkhtmltopdf", "--enable-local-file-access", "--orientation", "landscape", "--page-size", "A3", "file:////tmp/wicked_pdf20230705-21-m0s5hb.html", "/tmp/wicked_pdf_generated_file20230705-21-zglj39.pdf"] Error: PDF could not be generated! Command Error: /usr/local/bundle/gems/wkhtmltopdf-binary-0.12.6.6/bin/wkhtmltopdf_debian_10_amd64: error while loading shared libraries: libpng16.so.16: cannot open shared object file: No such file or directory

we ugraded our server OS to debian 12 and started getting this same error,

mcg commented 1 year ago

Just hit this trying an update to Bookworm.

mcg commented 1 year ago

Fyi, it appears the binary has been build for bookworm, https://github.com/wkhtmltopdf/packaging/issues/155

hrdwdmrbl commented 1 year ago

I DID IT!

I was using fullstaq-ruby:3.2.2-jemalloc-slim and I was getting /rails/vendor/ruby/3.2.0/gems/wkhtmltopdf-binary-0.12.6.6/bin/wkhtmltopdf_debian_10_amd64: error while loading shared libraries: libjpeg.so.62: cannot open shared object file: No such file or directory

I was able to install the correct wkhtmltopdf binary using:

apt-get install software-properties-common
add-apt-repository 'deb http://ftp.us.debian.org/debian bookworm main'
apt-get update && apt install wkhtmltopdf

but then I got weird errors about glibc so I also switched to ruby:3.2.2-bullseye like everyone else

mcg commented 1 year ago

Sorry to poke this again, but will we see a new gem with the bookworm update?

mende1 commented 9 months ago

@igorkasyanchuk I didn't modify a Gemfile. I updated docker images tags from: ruby:3.2 to ruby:3.2-bullseye. Does it answer your question?

Works wonderfuly wonderfully for me. Thankx

diei commented 7 months ago

Please provide a new binary. I get the same error with the Docker image ruby:3.3.0-bookworm:

/usr/local/bundle/gems/wkhtmltopdf-binary-0.12.6.6/bin/wkhtmltopdf_debian_10_amd64: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory

jalaj-hn commented 7 months ago

Please provide a new binary. I get the same error with the Docker image ruby:3.3.0-bookworm:

/usr/local/bundle/gems/wkhtmltopdf-binary-0.12.6.6/bin/wkhtmltopdf_debian_10_amd64: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory

Try ruby:3.2.2-bullseye

diei commented 7 months ago

@jalaj-hn, ruby:3.3.0-bullseye works, but this should be only a temporarily workaround. I have updated all my systems to Debian Bookworm and only wkhtmltopdf prevents the update of the last system.

mcg commented 7 months ago

As I mentioned in https://github.com/zakird/wkhtmltopdf_binary_gem/issues/162#issuecomment-1710709529 the binary for Bookworm exists, it's a matter of a PR here to include support for it. I see a few open PR's that add support for other distros/archs, so I am unsure if the project is active and would accept a PR. Given the state of https://github.com/wkhtmltopdf/packaging being archived, I do wonder how much longer can expect any of this to be supported.

unixmonkey commented 7 months ago

Well, originally there was really just a handful of "fat" binaries in this project, because that's what was distributed through official wkhtmltopdf releases. That made it really easy to have a gem with just a few binaries (Windows, MacOS, Linux x86, Linux x64).

Then wkhtmltopdf changed it's process to release different versions for every distribution, and this project has exploded to be hundreds of megabytes from including all the different variants. I'm pretty sure there might be different versions of wkhtmtopdf in here too. It used to be each version of this gem tracked a specific version of wkhtmltopdf.

I'm not at all against adding support for more variants and versions, but something needs to be done to control how big this project gets, and I hesistate on accepting a binary without comparing it's checksum to an official release. I wouldn't want someone to get a poisoned binary from this project.

mcg commented 7 months ago

@unixmonkey is "wkhtmltopdf/packaging" where the official releases live? If so then at least they have an official for Bookworm. I was also looking at https://github.com/zakird/wkhtmltopdf_binary_gem/pull/129 which is attempting to remove the bloat from all the binaries. Is that something worth doing considering the state of wkhtmltopdf generally?

unixmonkey commented 6 months ago

Debian 12 support (amd64/i386/arm64) is now in version 0.12.6.7. Please check it and make sure it works for you, and reopen if it doesn't. Thanks!