Environment: Production Invoice Ninja Self Hosted - version 5.3.68 being upgraded from the self update web console to v5.3.74
OS - Debian 10 server with current security patches (Linux)
PHP - v8.0.16 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
Error and Issue: Upgrading Invoice Ninja from v5.3.68 to v5.3.74 via the self update within the web application console. After the update is completed the webpage reloads and displays the 500 -server error page. From the SSH console of the instance, when trying to run sudo -u www-data php artisan optimize the command fails with the following error message
PHP Fatal error: Trait “Awobaz\Compoships\Compoships” not found in /var/www/html/invoiceninja/app/Models/Company.php on line 29
From the SSH console on the hosted instance I ran this command to correct the issue sudo composer require mpyw/compoships-eager-limit
After this command completed, I was able to successfully run sudo -u www-data php artisan optimize and the web console was reloaded without issue or error message. (Control + F5 to run a “hard” page reload)
Composer is not installed by default installation guides in most cases. If you are having issues running the above command, lookup the steps to install the composer or download the full .zip file of the latest build which includes the needed vendor files.
This seems to be the issue with the released update for Invoice Ninja. It seems the update could be re-released to include the necessary bits to complete the update without issue. The work around I provided will get admins back up and working until then.
What would you recommend in my case?
I downloaded the full release (v5.3.74, 216 MB) and copied the files over my existing installation. update?secret=secret led to an error 500. That’s the log report:
Same issue hier. Version 5.3.64 installed via Softaculous but when performing upgrade to version v5.3.74 in the app I got the error and even after manual overwritting all the files with v5.3.75 and performind the /update?secret= I still have the same issue.
I also get emails of my Artisan cronjob
In Company.php line 29:
Trait ‘Awobaz\Compoships\Compoships’ not found
Went back to version 5.3.64 via restore in my Softaculous and then performed update? again and then everything works fine. but get this notification