wkhtmltopdf_binary_gem icon indicating copy to clipboard operation
wkhtmltopdf_binary_gem copied to clipboard

support debian 12 bookworm (add new binaries)

Open adamzapasnik opened this issue 2 years ago • 11 comments

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)

adamzapasnik avatar Jun 15 '23 09:06 adamzapasnik

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

igorkasyanchuk avatar Jun 15 '23 09:06 igorkasyanchuk

@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?

adamzapasnik avatar Jun 15 '23 10:06 adamzapasnik

thanks for reply, trying what you suggested 👍

igorkasyanchuk avatar Jun 15 '23 10:06 igorkasyanchuk

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)

bibstha avatar Jun 18 '23 00:06 bibstha

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

WhisperClaims avatar Jun 20 '23 09:06 WhisperClaims

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,

shubhamMishra112 avatar Jul 14 '23 02:07 shubhamMishra112

Just hit this trying an update to Bookworm.

mcg avatar Sep 07 '23 20:09 mcg

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

mcg avatar Sep 07 '23 20:09 mcg

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

hrdwdmrbl avatar Oct 10 '23 01:10 hrdwdmrbl

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

mcg avatar Oct 27 '23 20:10 mcg

@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

mende1 avatar Feb 06 '24 13:02 mende1

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

diei avatar Apr 16 '24 11:04 diei

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

jalaj-hn avatar Apr 16 '24 11:04 jalaj-hn

@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.

diei avatar Apr 16 '24 12:04 diei

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.

mcg avatar Apr 16 '24 13:04 mcg

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.

unixmonkey avatar Apr 16 '24 15:04 unixmonkey

@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?

mcg avatar Apr 16 '24 15:04 mcg

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!

unixmonkey avatar May 10 '24 02:05 unixmonkey