Error 500: There was an error generating the PDF with Phantom JS

Hi,

After updating to the latest version through the portal, I could not generate PDF’s anymore.

I use PhantomJS public cloud PDF generator for PDF’s because I have it running on shared hosting.

This is the error I get in the logs:

[2022-07-29 06:53:27] production.INFO: https://my.invoiceninaj.com/phantom/invoice/AUGfp3MGuHmnEBiQIVMQbyhJkAjTjj3g?phantomjs_secret=secret
[2022-07-29 06:53:27] production.ERROR: There was an error generating the PDF with Phantom JS {“exception”:"[object] (App\Exceptions\PhantomPDFFailure(code: 0): There was an error generating the PDF with Phantom JS at /home/clients/15f153e506bfcee02335069cf4812c82/sites/my.invoiceninaj.com/app/Utils/PhantomJS/Phantom.php:156)

Screenshot of the error: https://i.imgur.com/jSiPPgr.png

I looked in the forums for other similar issues but not of the solutions worked for me.

Any thoughts?

Hi,

You may want to change to hosted_ninja

https://invoiceninja.github.io/docs/self-host-troubleshooting/#hosted-invoice-ninja-pdf-generation

Thanks.

Do I comment out the PhantomJS settings in .env?

I believe if you change to hosted_ninja they should be ignored

Hi,

It worked once then I kept getting the same PhantomJS error again.

I commented out the PhantomJS settings and that did the job.

Thank you.

Glad to hear it, thanks for the update!