I did a fresh install of Invoice Ninja v5 on a brand new installation of ISPConfig (running Ubuntu 20.04 with PHP 7.4, Apache, and Let’s Encrypt SSL Cert for the sub-domain I’m running it on). No errors on the initial installation checks.
I’ve created one company, and one product, and when I go to create an invoice, hitting save generates the following error:
I’ve checked the ownership on the Storage folder, and they are correct for the ISPConfig environment. I’ve tried changing folder permissions from 755 to 777 and back to 755. I’ve cleared the cache as well as run php artisan optimize.
It’s entirely possible. I’ve registered for a PhantomJS key, as well as purchased the White Label option. I will be doing some additional testing with the White Label first.
I will add in my white label key, and then these two lines into my .env file
I can’t tell for sure if this would work on your server, but here are my self hosted PDF settings in my .env file, which work fine on my end on a shared server, if that helps:
Creating a new invoice and saving it (without trying to view) is currently giving me:
TimeoutException after 0:00:30.000000: Future not completed - I believe this is due to email settings which I believe are ok, but can’t test at the moment.
I do not see any additional entries in the error log after doing this.
When I click on the Invoice section again, I’m prompted to either continue editing or discard changes.
Discarding changes and refreshing my browser results in a new invoice showing up, but the number is showing “Pending”
Opening that pending invoice and trying to save again results in a 500: Server Error.
Clicking the Invoice section again does not result in the same prompt to discard my changes as above.
The invoice is still showing “Pending” for the number. Error log still showing no additional entries.
Opening this invoice again and trying to view the PDF results in another 500: Server Error. Still number pending, and no error logs.
Logged completely out, and back into InvoiceNinja.
Opened Invoice and hit Save. 500: Server Error. Still shows as number pending.
Logged out, ran PHP ARTISAN OPTIMIZE, logged back in, edited invoice and saved. 500: Server Error. Nothing in log.
Tried viewing PDF without navigating elsewhere first. Same 500 Server Error.
I deleted my logo file that I uploaded, then logged out, ran PHP ARTISAN KEY:GENERATE and OPTIMIZE, then logged back in. The invoice had been populated with a number, and I’m seeing below in the log file. The new_logo.png file is viewable from a web browser.
[2021-08-03 18:12:55] production.ERROR: file_get_contents(https://xxxxxx.xxxxxx.ca/images/new_logo.png): failed to open stream: Connection timed out {“userId”:1,“exception”:"[object] (ErrorException(code: 0): file_get_contents(https://xxxxxx.xxxxxx.ca/images/new_logo.png): failed to open stream: Connection timed out at /var/www/clients/clientX/webX/finance/app/Models/Presenters/CompanyPresenter.php:72)
I checked my firewall and tested turning off all Advanced Threat Protection and Intrusion Prevention on the firewall rules. Additional testing did not reveal any positive results, and I’m really at a lack of what to try next.
Well…I managed to figure it out. An errant firewall rule was not allowing the ISPConfig server to essentially talk to itself. The URLs above worked great from my PC, but I tried using WGET to the URL from the server itself and it timed out. Went searching through my firewall rules and found the issue.
UGH! Glad to have it fixed, but oh man is that frustrating.
Thank you to everyone who chimed in with suggestions.