Forum archive
Invoice Ninja v5 Issues Found + Resolved
First of all i would like to apologize for my post yeasterday, reading back on your fixes Jeremy I realized that what i put could come across as a bit abrupt.
This will be a long post but i will try and include everything with detail not only for other users but also for the devs of the appliance in hope it may catch a future update.
I have started a new post as the other one was a bit messy.
Findings out of the box (OOTB)
Emails queue but do not send
"TECH" template does not work
Company logo will upload but will not display
When creating and invoice or quote click on the "View PDF" button at the top of the screen does not work and constantly tries to load with a spinning circle
Client portal does not open and loads http:/example.com
System healthcheck by clicking the bold i (information) in the bottom left corner and going to healthcheck displays issues todo with
* php size too small should be 512mb at least
* Queue not enabled
*SnapPDF not enabled
Attempts to fix but does not solve the issues
Clicking on "Settings" then Client Portal and adding in your URL under Domain URL solves nothing as the "Login URL" is http://example.com
These 2 MUST have the same domain entered be it an actual domain address or a local IP address, they must be the same.
Clicking on "Settings" then "Email Settings" does not allow the entry of any SMTP details and filling out the fields available solves nothing, also turning on the option for "Attach PDF" it does not attach or send an email for that matter.
Fixes and resolutions for me that worked.
First off Jeremys fix for the PHP size to 512mb worked
sed -i "\|^memory_limit|s|=.*|= 512M|" /etc/php/8.1/apache2/php.ini systemctl restart apache2
This solves the issue of PHP size in the "System Health Check"
Second
Invoice Ninja will work Locally on a local IP address without any SSL but the .env file must be edited for this to happen and also SnapPDF must be installed to enable local PDF generation.
OOTB it uses an external service for this, Jeremy did post how to do this but currently i can not find the post to add it in.
To enable and use SnapPDF after it is installed you need to edit the .env file variables PDF_GENERATOR=hosted_ninja must be changed to PDF_GENERATOR=snappdf (do not use "")
Third
If you are using a domain you dont have to use SSL (https) you can use (http) but you must make the appliance accessible from the internet by forwarding ports on your router and also configuring your domains DNS to point to you IP (if just using IP it must be the external address)
.env file changes that must be made for the appliance to operate correctly
The most important variable to change is this
APP_URL="http://example.com"
http://example.com must be changed to however/wherever you will access invoice ninja from for example..
If you are accessing the appliance locally then this must be changed to the Local IP address of the appliance, such as APP_URL="http://192.168.1.100"
or if accessing from the internet after you have forwarded you port 80 to your local machine you will use your external IP Address such as APP_URL="http://81.777.666.555"
I'm sure you get the idea but just to conclude a domain as well APP_URL="http://invoice.mydomain.com"
Notice the above examples or NOT using SSL (https) this is perfectly fine but if you are not using SSL (https) you MUST also change REQUIRE_HTTPS="true" to REQUIRE_HTTPS="false"
If you are using SSL (https) such as "https://invoice.mydomain.com" then the APP_URL="https://invoice.mydomain.com and the REQUIRE_HTTPS="true" will remain as is OOTB
we will address the queue not running as well while we are here.
As already been tested by Jeremy the Cronjob works its just the queue is not enabled in invoice ninja so still in the .env file change the QUEUE_CONNECTION=sync to
QUEUE_CONNECTION=database (do not use "" on this one)
Save changes
Now execute the commands provided by Jeremy
runuser -l www-data -s /bin/bash -c "php /var/www/invoiceninja/artisan optimize"
systemctl restart apache2
Now going back into the application clicking on "Settings" then "Client Portal" the "Login URL" now displays for example "https://invoice.mydomain.com/client/login"
The field above "Domain URL" must read the same without /client/login so in this case would be "https://invoice.mydomain.com" and save changes by clicking the green Save button (top right)
After this PDF generation should work this can be tested by creating an invoice and clicking View PDF, this also fixes the logo not displaying and if you wish to use the client portal that should also now load correctly.
Note if you already have invoices created before the above changes the logos will not appear on them and you will have to recreate them to pull down the logo from the correct location.
Also checking the Server Health Check this should now have removed all the warnings apart from SnapPDF if you have not installed and enabled it in the .env file.
EMAILS
Back to the .env file again and edit the following
MAIL_MAILER="log"
MAIL_HOST=
MAIL_PORT=
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION="tls"
MAIL_FROM_ADDRESS=""
MAIL_FROM_NAME=""
YOU MUST USE "" IN ALL OF THE FIELDS OTHERWISE INVOICE NINJA WILL BREAK
Change MAIL_MAILER="log" to MAIL_MAILER="smtp" <<< Most important
The rest of them change to your smtp servers details i will use google as an example
MAIL_MAILER="smtp"
MAIL_HOST="smtp.gmail.com"
MAIL_PORT="587"
MAIL_USERNAME="myemailaddress@gmail.com"
MAIL_PASSWORD="mygoogleaccountpassword"
MAIL_ENCRYPTION="tls"
MAIL_FROM_ADDRESS="myemailaddress@google.com"
MAIL_FROM_NAME="My Name"
again once this is done save your changes and run the following commands
runuser -l www-data -s /bin/bash -c "php /var/www/invoiceninja/artisan optimize"
systemctl restart apache2
Now in conclusion to all of the above the main issue of having to do all of the above is the initial setup for invoice ninja is pre canned / already completed, as this setup page is only displayed on first install of invoice ninja this is the only option to actually input all of the above settings in the form and also choose if you with to use SSL or not.
see the link to a youtube video i found showing the said setup page that we dont get an option to configure
v5 Self Host Installation - YouTube skip the video to 1:20
If the setup page was displayed all of the above could be avoided and the appliance would work flawless OOTB and also the inclusion of SnapPDF
Anyway its took me an hour to put this up and about 3 hours to solve last nights strange behavior but I was not prepared to give up on this appliance that quick.
I hope this helps other users and the devs to implement a fix for a future update, any questions please ask i will do my best to answer them.
Just come across something im not sure on the answer to,
Invoice Ninja states there is an update available, but when trying to update the update fails with server error ?
Any ideas?