500 Phantom_JS issue persists

Hi Guys,

Suddenly getting phantomJS issues again generating a 500 error:

[2022-11-05 11:22:32] 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/spacedotnet/public_html/nja/app/Utils/PhantomJS/Phantom.php:157)
[stacktrace]

Have read the earlier posts and have fully updated Ninja to the latest version and adjusted the .env file to try to set it to hosted_ninja including commenting out the phantom key lines, but it still seems to be stuck on Phantom even after logging back out and in etc. Have removed details for security

NINJA_ENVIRONMENT=“selfhost”

#options - snappdf / phantom / hosted_ninja
PDF_GENERATOR=hosted_ninja

#PHANTOMJS_KEY=’
#PHANTOMJS_SECRET=

How do I resolve this issue or check what the PDF generator is?
Will the old invoices get recreated by hosted_ninja cause right now it just want show anything without a 500

Thanks!

Hi,

If may help to run php artisan optimize or load /update?secret= in the browser.

Note: you can check which PDF renderer is being used using the health check option in the about dialog.

Thanks so much Hillel, seems to have sorted it and I won’t miss all the issues with PhantomJS.
I’m still trying to get Cron to work, so perhaps best if I post on that in a new ticket when I have looked more deeply into it.

Still getting 500 errors from phantom JS
I have run artisan optimize and my env looks like this (keys removed) but still says phantom in the health check:

#options - snappdf / phantom / hosted_ninja
PDF_GENERATOR=hosted_ninja

#PHANTOMJS_KEY=
#PHANTOMJS_SECRET=

What do I actually have to do to force this to behave itself Hillel?

@david any thoughts?

Thanks Hillel,

I’m running php artisan optimize in a shell in my ninja directory and it returns nothing, but no error so presume it worked?
How do you run /update?secret=secret
I know what my secret key is but just wondered if that is run in shell or browser?
Sorry for the dumb question.

Maybe easier if I do another upgrade if David thinks that he fixed the issue recently?

You load the URL in your browser, ie. https://example.com/update

Just get 404… grabbing secret from bottom of env file
nja.metaspace.net.au/public/update?secret=******

@kororo

it looks like your .htaccess file isn’t rewriting the index.php portion out of the URL

you’’ want to try something like this:

https://***************.net.au/public/index.php/update?secret=