• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue sh: gs: command not found exporting files as pdf

Might just need to get https://raw.githubusercontent.com/plesk/kb-scripts/master/update-chroot/update-chroot.sh and then run
curl -o update-chroot.sh https://raw.githubusercontent.com/plesk/kb-scripts/master/update-chroot/update-chroot.sh
chmod +x update-chroot.sh
./update-chroot.sh --add /bin/bash
and then supposedly
This will add the /bin/bash executable to the chroot environment, making it available within the chrooted environment for any domains where you later apply the template.

Perhaps @Peter Debik knows more about this.

But then I wonder. If that provides access to /bin/bash .. does that allow Ghostscript commands to be run by chrooted user? I think we then need

./update-chroot.sh --add /path/to/ghostscript-binary

And then I assume these have to be run by root as shown at https://support.plesk.com/hc/en-us/...chrooted-shell-environment-template-in-Plesk-
 
Did the following:
[root@adminsite site.nl]# curl -o update-chroot.sh https://raw.githubusercontent.com/plesk/kb-scripts/master/update-chroot/update-chroot.sh
[root@adminsite site.nl]# chmod +x update-chroot.sh
[root@adminsite site.nl]# which gs
/usr/bin/gs
[root@adminsite site.nl]# ./update-chroot.sh --add /usr/bin/gs
'/lib64/libgs.so.9' -> '/var/www/vhosts/chroot/lib64/libgs.so.9'
'/lib64/libtiff.so.5' -> '/var/www/vhosts/chroot/lib64/libtiff.so.5'
'/lib64/libcupsimage.so.2' -> '/var/www/vhosts/chroot/lib64/libcupsimage.so.2'
'/lib64/libcups.so.2' -> '/var/www/vhosts/chroot/lib64/libcups.so.2'
'/lib64/libijs-0.35.so' -> '/var/www/vhosts/chroot/lib64/libijs-0.35.so'
'/lib64/libpng16.so.16' -> '/var/www/vhosts/chroot/lib64/libpng16.so.16'
'/lib64/libjbig2dec.so.0' -> '/var/www/vhosts/chroot/lib64/libjbig2dec.so.0'
'/lib64/libjpeg.so.62' -> '/var/www/vhosts/chroot/lib64/libjpeg.so.62'
'/lib64/liblcms2.so.2' -> '/var/www/vhosts/chroot/lib64/liblcms2.so.2'
.......
'/lib64/libsystemd.so.0' -> '/var/www/vhosts/chroot/lib64/libsystemd.so.0'
'/lib64/liblzma.so.5' -> '/var/www/vhosts/chroot/lib64/liblzma.so.5'
'/lib64/liblz4.so.1' -> '/var/www/vhosts/chroot/lib64/liblz4.so.1'
'/lib64/libmount.so.1' -> '/var/www/vhosts/chroot/lib64/libmount.so.1'
'/lib64/libgcrypt.so.20' -> '/var/www/vhosts/chroot/lib64/libgcrypt.so.20'
'/lib64/libgcc_s.so.1' -> '/var/www/vhosts/chroot/lib64/libgcc_s.so.1'
'/lib64/libblkid.so.1' -> '/var/www/vhosts/chroot/lib64/libblkid.so.1'
'/usr/bin/gs' -> '/var/www/vhosts/chroot/usr/bin/gs'
'/etc/ld.so.conf' -> '/var/www/vhosts/chroot/etc/ld.so.conf'
'/etc/ld.so.conf.d' -> '/var/www/vhosts/chroot/etc/ld.so.conf.d'
'/etc/ld.so.conf.d/kernel-4.18.0-477.13.1.el8_8.x86_64.conf' -> '/var/www/vhosts/chroot/etc/ld.so.conf.d/kernel-4.18.0-477.13.1.el8_8.x86_64.conf'
'/etc/ld.so.conf.d/kernel-4.18.0-477.10.1.el8_8.x86_64.conf' -> '/var/www/vhosts/chroot/etc/ld.so.conf.d/kernel-4.18.0-477.10.1.el8_8.x86_64.conf'
'/etc/ld.so.conf.d/bind-export-x86_64.conf' -> '/var/www/vhosts/chroot/etc/ld.so.conf.d/bind-export-x86_64.conf'
'/usr/sbin/ldconfig' -> '/var/www/vhosts/chroot/usr/sbin/ldconfig'
Done! Do not forget to run './update-chroot.sh --apply domains...' to apply changes in chroot template to domains.
[root@adminsite site.nl]# ./update-chroot.sh --apply all

Then I tried to generate the pdf in Fancy Product Designer one more time, but it still failed. Not sure why. The command

tail /var/log/plesk-php80-fpm/error.log

Did not show gs errors.
 
Do see

2023/10/08 12:04:14 [error] 687042#0: *41102 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 212.30.37.30, server: snaakontwerp.nl, request: "POST /wp-admin/admin-ajax.php?action=fpd_create_file_export&_ajax_nonce=3a82c30ea0 HTTP/2.0", upstream: "fastcgi://unix:/var/www/vhosts/system/site.nl/php-fpm.sock:", host: "snaakontwerp.nl", referrer: "Site.nl: Domeinnaam en webhosting - Ga online, begin nu!"
 
Hmm, last error was an earlier one. Do see error 500 in the console log and in logs

Error2404:8000:1001:f8dc:f8d5:4e2c:f040:6ec2500POST /wp-admin/admin-ajax.php?action=fpd_create_file_export&_ajax_nonce=0ebb414297 HTTP/2.0

but I do not see what the error 500 is based on now. Do think it again an issue with Ghostscript / Imagick.
 
Well, a new plugin update now stores the print jobs in a separate table, which seems to help avoiding the transient job error and allow for pdfs to be printed. In the end Ghostscript was not necessary for Fancy Product Designer . Which makes me wonder what script or program did call gs causing the error.

The pdf exporting now works. The print job table storage seems to avoid any error 500s.

Default MariaDB version installed with Plesk is outdated and needs updating. Seems you cannot do this from the panel. Will work on that later on however.

I am happy to call this issue closed
 
Back
Top