Purchase Order Generate PDF Error "Promise was rejected with a value of 'undefined'

I am getting errors when generating PDF’s in Purchase Orders. All other modules can generate PDFs fine only with PO that I am getting this error. Am I missing something?

Version: 5.5.78-C108

This is the error I am getting:

“Promise was rejected with a value of ‘undefined’.”

Hi,

@david any ideas?

@mozi340

You’ll want to inspect the logs in storage/logs/laravel.log

It doesn’t seem to show any logs related to this when generating the PDF.

I have exactly the same issue … no message in the log!?

GV

@mozi340 @george3430

Can you advise if 5.5.84 fixes this?

It Seems to fix it in my dev system … about to try it in my prod system … just running a back up now just in case …
GV

Hi David,

5.5.84 fixed it … thx

GV

1 Like

v5.5.84 fixed mine as well.

thanks!

1 Like

@david I am on v5.5.86-C109 and that error message is shown when using Invoice Design → Show Preview is toggled on as well.

@classicpatrick

Can you advise the last error in storage/logs/laravel.log

[2023-03-11 05:03:25] production.ERROR: The process "'/usr/share/nginx/invoiceninja/vendor/beganovich/snappdf/versions/1107974-Linux_x64/chrome-linux/chrome' '--headless' '--disable-gpu' '--disable-translate' '--disable-extensions' '--disable-sync' '--disable-background-networking' '--disable-software-rasterizer' '--disable-default-apps' '--disable-dev-shm-usage' '--safebrowsing-disable-auto-update' '--run-all-compositor-stages-before-draw' '--no-first-run' '--no-margins' '--no-sandbox' '--print-to-pdf-no-header' '--hide-scrollbars' '--ignore-certificate-errors' '--print-to-pdf=/tmp/pdf_JKkYx4.pdf' '/tmp/html_B0Tp82.html'" exceeded the timeout of 60 seconds. {"userId":1,"exception":"[object] (Symfony\\Component\\Process\\Exception\\ProcessTimedOutException(code: 0): The process \"'/usr/share/nginx/invoiceninja/vendor/beganovich/snappdf/versions/1107974-Linux_x64/chrome-linux/chrome' '--headless' '--disable-gpu' '--disable-translate' '--disable-extensions' '--disable-sync' '--disable-background-networking' '--disable-software-rasterizer' '--disable-default-apps' '--disable-dev-shm-usage' '--safebrowsing-disable-auto-update' '--run-all-compositor-stages-before-draw' '--no-first-run' '--no-margins' '--no-sandbox' '--print-to-pdf-no-header' '--hide-scrollbars' '--ignore-certificate-errors' '--print-to-pdf=/tmp/pdf_JKkYx4.pdf' '/tmp/html_B0Tp82.html'\" exceeded the timeout of 60 seconds. at /usr/share/nginx/invoiceninja/vendor/symfony/process/Process.php:1154)

@classicpatrick

Can you advise if all PDFs are failing to generate, or only some? ie. just Purchase Orders, just in the Invoice Design Preview.

Just in the invoice design preview. all other PDFs generate without issue

@classicpatrick

Are you on 5.5.87?

Are there any other errors in the logs, or jus the chrome timeout one?

That is the only line in the log that shows up when the error displays. I am on version v5.5.88-C109 and still produced the error

@classicpatrick

Thanks for persisting with me, I’ve found this issue and will tag a fix in .89

1 Like

I have this same issue

when I try to generate an invoice I get this

image

image

Linux Version
root@wwinvninj2 ~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye

Apace Vesion
root@wwinvninj2 ~# /usr/sbin/apache2 -v
Server version: Apache/2.4.56 (Debian)
Server built: 2023-03-08T03:05:04

It seems to be moaning about Chrome …

See Laravel Log below

[2023-03-22 01:44:03] production.ERROR: The command “‘/var/www/invoiceninja/vendor/beganovich/snappdf/versions/1083420-Linux_x64/chrome-linux/chrome’ ‘–headless’ ‘–disable-gpu’ ‘–disable-translate’ ‘–disable-extensions’ ‘–disable-sync’ ‘–disable-background-networking’ ‘–disable-software-rasterizer’ ‘–disable-default-apps’ ‘–disable-dev-shm-usage’ ‘–safebrowsing-disable-auto-update’ ‘–run-all-compositor-stages-before-draw’ ‘–no-first-run’ ‘–no-margins’ ‘–no-sandbox’ ‘–print-to-pdf-no-header’ ‘–hide-scrollbars’ ‘–ignore-certificate-errors’ ‘–print-to-pdf=/tmp/pdf_Db9WPs.pdf’ ‘/tmp/html_HwMt9v.html’” failed.

Exit Code: 127(Command not found)

Working directory: /var/www/invoiceninja/public

Output:

Error Output:

/var/www/invoiceninja/vendor/beganovich/snappdf/versions/1083420-Linux_x64/chrome-linux/chrome:

error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory

{“userId”:2,“exception”:"[object] (Symfony\Component\Process\Exception\ProcessFailedException(code: 0): The command "‘/var/www/invoiceninja/vendor/beganovich/snappdf/versions/1083420-Linux_x64/chrome-linux/chrome’ ‘–headless’ ‘–disable-gpu’ ‘–disable-translate’ ‘–disable-extensions’ ‘–disable-sync’ ‘–disable-background-networking’ ‘–disable-software-rasterizer’ ‘–disable-default-apps’ ‘–disable-dev-shm-usage’ ‘–safebrowsing-disable-auto-update’ ‘–run-all-compositor-stages-before-draw’ ‘–no-first-run’ ‘–no-margins’ ‘–no-sandbox’ ‘–print-to-pdf-no-header’ ‘–hide-scrollbars’ ‘–ignore-certificate-errors’ ‘–print-to-pdf=/tmp/pdf_Db9WPs.pdf’ ‘/tmp/html_HwMt9v.html’" failed.

Exit Code: 127(Command not found)

Working directory: /var/www/invoiceninja/public

George V

This isn’t the same issue. Your subsystem is missing dependencies which Chrome needs to generate the pdfs

You can find the list of dependencies here