Blurry PDF, 500 errors, duplicate Invoices

Hello,
I have never had this program working properly.
I am using a shared hosting company, 1 click install was v4 and I have upgraded to v5 running PHPv8.0

I have created a PhantomJS key, I have cleared the cache.

Creating invoices this morning, when I click save it errors with a 500.
Trying to come out the invoice it says ‘dismiss or continue’
This is resulting in multiple invoices being created. I have no idea if they are being sent after email button pressed as it errors again.

Only things I can control / edit is the files that have been installed, I have no access to the server as it is on shared hosting

Cheers Neil

Hi,

Which exact version of the app are you using? There was a recent change which should have improved the PDF clarity in the preview.

If you’re seeing a 500 there should be more details about the error in the logs in storage/logs. You should be able to access the files via FTP with shared hosting.

v5.3.66-C77

There is no logs from 4th May in this logfile.

Here is an error from a couple of months ago

production.ERROR: There was an error generating the PDF with Phantom JS {“userId”:1,“exception”:"[object] (App\Exceptions\PhantomPDFFailure(code: 0): There was an error generating the PDF with Phantom JS at /home/sites/12b/1/1441a820db/public_html/account/app/Utils/PhantomJS/Phantom.php:150)

If you update to the latest version it should help with the blurry PDF preview.

For the Phantom JS error it may help to create an account if you haven’t already. If you have a white label license you can use the hosted SnapPDF option.

https://invoiceninja.github.io/docs/self-host-troubleshooting/#pdf-conversion-issues

I have attempted to do the PhantomJS update, registered with website and got my API key
I do not find the instructions very clear (appreciate they are trying to cover multiple OS’s) however PHANTOMJS_SECRET=‘your-secret-here’ ← Does this require the quote marks?

And where / how do you run php artisan optimize?

Also, what is the latest version? Where is best to get it from, When I click on the info button, check for update it tells me I am on the latest, I do however force update and nothing has updated

The quotes may not be required but are a good idea.

You can run it from the command line in the root folder of the project. If you don’t have SSH access it may work to load /update?secret= in the browser.

The latest version is currently v5.3.85, there is a download link available here:

https://www.invoiceninja.org

Screenshot 2022-05-06 114042

And here is my cron :
cd /home/sites/12b/1/1441a820db/public_html/account && /usr/bin/php -d register_argc_argv=On artisan schedule:run >> /dev/null 2>&1

Being on shared hosting, I do not have access to root, so cannot update to 5.3.85

Thanks, it looks like your config isn’t cached so changes to the .env file should take effect immediately.

You can copy over the latest zip to update the app.

https://github.com/invoiceninja/invoiceninja/releases/download/v5.3.85/invoiceninja.zip

Well as I wanted to keep settings etc…
I used the source code .zip file.
Copied all these unzipped files to the folder Ninja was installed to originally and now I cannot log in, completely screwed now. 500 - server error, will not load login page.

As I said previously the instructions are very poorly written. The target audience of this software is such that there could be little to no linux experience and access to certain parts of shared servers restricted.

This has been a nightmare from start to finish

There should be more details about the 500 error in storage/logs

[2022-05-06 11:48:43] production.ERROR: Trait “Awobaz\Compoships\Compoships” not found {“exception”:"[object] (Symfony\Component\ErrorHandler\Error\FatalError(code: 0): Trait “Awobaz\Compoships\Compoships” not found at /home/sites/12b/1/1441a820db/public_html/account/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"}

Thanks, please try deleting the bootstrap/cache folder

I renamed the folder rather than delete, and that made it worse.
at least before I was getting the picture of the imacs, but now just a 500 error from the browser rather than the Ninja page saying 500

Has the error in storage/logs changed?

@david do you have any thoughts?

Nothing get added to the logs after I rename the cache fold to old-cache
Screenshot 2022-05-06 134511

Are there any errors in the web server error logs?

account.precisioncomputing.co.uk [Fri May 06 14:20:16 2022] [error] [client xxx.xxx.xxx.xxx:0] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught ReflectionException: Class “view” does not exist in /home/sites/12b/1/1441a820db/public_html/account/vendor/laravel/framework/src/Illuminate/Container/Container.php:877\nStack trace:\n#0 /home/sites/12b/1/1441a820db/public_html/account/vendor/laravel/framework/src/Illuminate/Container/Container.php(877): ReflectionClass->__construct(‘view’)\n#1 /home/sites/12b/1/1441a820db/public_html/account/vendor/laravel/framework/src/Illuminate/Container/Container.php(758): Illuminate\Container\Container->build(‘view’)\n#2 /home/sites/12b/1/1441a820db/public_html/account/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(841): Illuminate\Container\Container->resolve(‘view’, Array, true)\n#3 /home/sites/12b/1/1441a820db/public_html/account/vendor/laravel/framework/src/Illuminate/Container/Container.php(694): Illuminate\Foundation\Applicati
account.precisioncomputing.co.uk [Fri May 06 14:20:19 2022] [error] [client xxx.xxx.xxx.xxx:0] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught ReflectionException: Class “view” does not exist in /home/sites/12b/1/1441a820db/public_html/account/vendor/laravel/framework/src/Illuminate/Container/Container.php:877\nStack trace:\n#0 /home/sites/12b/1/1441a820db/public_html/account/vendor/laravel/framework/src/Illuminate/Container/Container.php(877): ReflectionClass->__construct(‘view’)\n#1 /home/sites/12b/1/1441a820db/public_html/account/vendor/laravel/framework/src/Illuminate/Container/Container.php(758): Illuminate\Container\Container->build(‘view’)\n#2 /home/sites/12b/1/1441a820db/public_html/account/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(841): Illuminate\Container\Container->resolve(‘view’, Array, true)\n#3 /home/sites/12b/1/1441a820db/public_html/account/vendor/laravel/framework/src/Illuminate/Container/Container.php(694): Illuminate\Foundation\Applicati
account.precisioncomputing.co.uk [Fri May 06 14:20:20 2022] [error] [client xxx.xxx.xxx.xxx:0] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught ReflectionException: Class “view” does not exist in /home/sites/12b/1/1441a820db/public_html/account/vendor/laravel/framework/src/Illuminate/Container/Container.php:877\nStack trace:\n#0 /home/sites/12b/1/1441a820db/public_html/account/vendor/laravel/framework/src/Illuminate/Container/Container.php(877): ReflectionClass->__construct(‘view’)\n#1 /home/sites/12b/1/1441a820db/public_html/account/vendor/laravel/framework/src/Illuminate/Container/Container.php(758): Illuminate\Container\Container->build(‘view’)\n#2 /home/sites/12b/1/1441a820db/public_html/account/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(841): Illuminate\Container\Container->resolve(‘view’, Array, true)\n#3 /home/sites/12b/1/1441a820db/public_html/account/vendor/laravel/framework/src/Illuminate/Container/Container.php(694): Illuminate\Foundation\Applicatiaccount.precisioncomputing.co.uk [Fri May 06 14:20:19 2022] [error] [client 129.215.86.1:0] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught ReflectionException: Class “view” does not exist in /home/sites/12b/1/1441a820db/public_html/account/vendor/laravel/framework/src/Illuminate/Container/Container.php:877\nStack trace:\n#0 /home/sites/12b/1/1441a820db/public_html/account/vendor/laravel/framework/src/Illuminate/Container/Container.php(877): ReflectionClass->__construct(‘view’)\n#1 /home/sites/12b/1/1441a820db/public_html/account/vendor/laravel/framework/src/Illuminate/Container/Container.php(758): Illuminate\Container\Container->build(‘view’)\n#2 /home/sites/12b/1/1441a820db/public_html/account/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(841): Illuminate\Container\Container->resolve(‘view’, Array, true)\n#3 /home/sites/12b/1/1441a820db/public_html/account/vendor/laravel/framework/src/Illuminate/Container/Container.php(694): Illuminate\Foundation\Applicati
account.precisioncomputing.co.uk [Fri May 06 14:20:20 2022] [error] [client 129.215.86.1:0] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught ReflectionException: Class “view” does not exist in /home/sites/12b/1/1441a820db/public_html/account/vendor/laravel/framework/src/Illuminate/Container/Container.php:877\nStack trace:\n#0 /home/sites/12b/1/1441a820db/public_html/account/vendor/laravel/framework/src/Illuminate/Container/Container.php(877): ReflectionClass->__construct(‘view’)\n#1 /home/sites/12b/1/1441a820db/public_html/account/vendor/laravel/framework/src/Illuminate/Container/Container.php(758): Illuminate\Container\Container->build(‘view’)\n#2 /home/sites/12b/1/1441a820db/public_html/account/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(841): Illuminate\Container\Container->resolve(‘view’, Array, true)\n#3 /home/sites/12b/1/1441a820db/public_html/account/vendor/laravel/framework/src/Illuminate/Container/Container.php(694): Illuminate\Foundation\Applicati

From this issue I think the error may either be from file permissions or having an un-enclosed space in the .env file

Here’s info on setting the correct permissions:

https://invoiceninja.github.io/docs/self-host-installation/#file-permissions

So I have now installed a fresh install of 5.3.85-C81
Have reused my old .env file to keep/link my database etc…
however I am still getting 500 errors on EVERYTHING I do.
I was trying to update the client portal from account.url.com to payments.url.com and 500 error!!
Logo will not upload.
So I can log into this new instance, however I can make no changes or create and send new invoices

My host does not use cPanel, they have designed their own custom, but still offer Ninja as a one click install so it must be compatible!

Can you please share the details about the 500 error from storage/logs?