Environment: Production Invoice Ninja Self Hosted v5.3.96
OS - Debian 10 server with current security patches (Linux)
PHP - v8.0.19 with current security patches
DataBase Engine - MySQL/MariaDB - Current version with latest security patches
Web Server - Apache v2.4.52 with current security patches
PDF Engine - Local SnapPDF (not using Phantom)
Other - Virtual Machine = yes
Other - VM is not Docker; private VM instance with dedicated resources
Bug: We needed to add a line item to a past due invoice to reflect late fees. There seems to be no issues adding the line item to the existing (past due) invoice and saving the edit. When we look at either the PDF or the client portal after the edit, the old invoice is displayed without the changes. Also when we download the PDF from the dashboard, the downloaded PDF does not show the change either
Can the Issue be Reproduced? We are able to reproduce this issue on demand
Other Info: The affected invoices are over a year old and were created as new invoices in v5, they were not part of our migration from Invoice Ninja v4. We only have these two past due invoices and can’t see if this issue affects past due invoices less than a year old
As a work around for the short term, we added the PDF maintenance task to the .env and set the days to 1. This got us the results we needed to get adjusted invoice out to our client.
Here is the output. Permissions errors are apparent.
What areas and permissions need to be adjusted? The current permissions for /var/www/html/invoiceninja/storage/logs/ are set to www-data
-rwxr-xr-x 1 www-data www-data 11639830 Jun 12 13:48 laravel.log
Output of php artisan queue:listen
┌─[xxxx@yyyyyyy]─[/var/www/html/invoiceninja]
└──╼ $php artisan queue:listen
[2022-06-12 17:49:53][12058] Processing: App\Jobs\Entity\EmailEntity
[2022-06-12 17:49:55][12058] Processed: App\Jobs\Entity\EmailEntity
[2022-06-12 17:49:55][12059] Processing: App\Listeners\Invoice\InvoiceEmailActivity
[2022-06-12 17:49:59][12059] Failed: App\Listeners\Invoice\InvoiceEmailActivity
In StreamHandler.php line 146:
The stream or file "/var/www/html/invoiceninja/storage/logs/laravel.log" co
uld not be opened in append mode: Failed to open stream: Permission denied
The exception occurred while attempting to log: The stream or file "/var/ww
w/html/invoiceninja/storage/logs/laravel.log" could not be opened in append
mode: Failed to open stream: Permission denied
The exception occurred while attempting to log: The stream or file "/var/ww
w/html/invoiceninja/storage/logs/laravel.log" could not be opened in append
mode: Failed to open stream: Permission denied
The exception occurred while attempting to log: file_put_contents(/var/www/
html/invoiceninja/public/storage/redacted.html): Failed to open stream: Perm
ission denied
Context: {"exception":{}}
Context: {"exception":{}}
Context: {"exception":{}}
[2022-06-12 17:50:00][12060] Processing: App\Listeners\Invoice\InvoiceEmailedNotification
[2022-06-12 17:50:00][12060] Processed: App\Listeners\Invoice\InvoiceEmailedNotification
[2022-06-12 17:50:00][12061] Processing: App\Listeners\Invoice\InvoiceEmailFailedActivity
[2022-06-12 17:50:06][12061] Failed: App\Listeners\Invoice\InvoiceEmailFailedActivity
In StreamHandler.php line 146:
The stream or file "/var/www/html/invoiceninja/storage/logs/laravel.log" co
uld not be opened in append mode: Failed to open stream: Permission denied
The exception occurred while attempting to log: The stream or file "/var/ww
w/html/invoiceninja/storage/logs/laravel.log" could not be opened in append
mode: Failed to open stream: Permission denied
The exception occurred while attempting to log: The stream or file "/var/ww
w/html/invoiceninja/storage/logs/laravel.log" could not be opened in append
mode: Failed to open stream: Permission denied
The exception occurred while attempting to log: file_put_contents(/var/www/
html/invoiceninja/public/storage/redacted.html): Failed to open stream: Perm
ission denied
Context: {"exception":{}}
Context: {"exception":{}}
Context: {"exception":{}}
[2022-06-12 17:50:52][12068] Processing: App\Jobs\Entity\EmailEntity
[2022-06-12 17:50:53][12068] Processed: App\Jobs\Entity\EmailEntity
[2022-06-12 17:50:54][12072] Processing: App\Jobs\Mail\NinjaMailerJob
[2022-06-12 17:50:54][12072] Processed: App\Jobs\Mail\NinjaMailerJob
[2022-06-12 17:50:54][12073] Processing: App\Jobs\Util\SystemLogger
[2022-06-12 17:50:54][12073] Processed: App\Jobs\Util\SystemLogger
[2022-06-12 17:50:55][12074] Processing: App\Listeners\Mail\MailSentListener
[2022-06-12 17:50:55][12074] Processed: App\Listeners\Mail\MailSentListener
[2022-06-12 17:50:59][12069] Processing: App\Listeners\Invoice\InvoiceEmailActivity
[2022-06-12 17:51:03][12069] Failed: App\Listeners\Invoice\InvoiceEmailActivity