wkhtmltopdf_binary_gem icon indicating copy to clipboard operation
wkhtmltopdf_binary_gem copied to clipboard

Missing libpng12 in AmazonLinux2023

Open strviola opened this issue 2 years ago • 2 comments

An error occured on AmazonLinux2023:

RuntimeError PDF could not be generated!
 Command Error: /var/www/app/shared/bundle/ruby/3.0.0/gems/wkhtmltopdf-binary-0.12.6.6/bin/wkhtmltopdf_centos_6_amd64: error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory
  • ruby version: 3.0.0
  • library version: wkhtmltopdf-binary-0.12.6.6

This is my cat /etc/os-release :

NAME="Amazon Linux"
VERSION="2023"
ID="amzn"
ID_LIKE="fedora"
VERSION_ID="2023"
PLATFORM_ID="platform:al2023"
PRETTY_NAME="Amazon Linux 2023"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2023"
HOME_URL="https://aws.amazon.com/linux/"
BUG_REPORT_URL="https://github.com/amazonlinux/amazon-linux-2023"
SUPPORT_END="2028-03-01"

I think bin/wkhtmltopdf should concern os is amzn_2023 at here:

           os = 'centos_6' if (os.start_with?('amzn_') && os != 'amzn_2') ||
                              (os.empty? && File.read('/etc/centos-release').start_with?('CentOS release 6'))

           os = 'centos_7' if (os.start_with?('amzn_2') && !os.start_with?('amzn_20')) ||
                              os.start_with?('rhel_7.')

strviola avatar Jun 14 '23 08:06 strviola

Can confirm this issue. I've tried hacking around it to make it use the centos 7 & 8 binaries, but the issue goes further than just the libpng version being used. Also ran into issues with libssl and libcrypto, which are both looking for versions 1.1 and the system has version 3.0.8 installed.

RescuePenguin avatar Dec 06 '23 18:12 RescuePenguin

I see this issue is marked as "completed on Apr 3". I'm still facing this issue. Any updates on it?

wimpog avatar Jul 01 '24 16:07 wimpog