Got Error 500 when upgrading from V5.3.66-W77 to V5.3.7x

Dear All, the details of my setup is as follows;

Server Type : Shared Hosting
Upgrade Method : InvoiceNinja internal App Upgrade
License : White Labeled User
PDF Server : Invoice Ninja Hosted PDF
Original InvoiceNinja Version : V5.3.66-W77

So when im upgrade it got error 500, when i check error in error log it says;

PHP Fatal error: Trait ‘Awobaz\Compoships\Compoships’ not found in app/Models/Company.php on line 29

So then i tried this suggestion by @david here ;
“can you try overwriting with this file please
https://github.com/invoiceninja/invoiceninja/releases/download/v5.3.71/invoiceninja.zip

The method i use is, i backup the .env file, and delete the whole folder, uploaded the fresh file, then extract, and put back the .env file

The the app running, BUT the already generated PDF cant be loaded (I didnt tried to generate new invoice to try).

So in this case, just maybe, what i need to do is Not to replace the whole folder content, maybe somebody can advice me, just what needed to be replace?

You should just overwrite the files with that package.

I’ve recently tagged 5.3.73, if you can overwrite with this file, and then run /update?secret=secret

if that doesn’t work, let us know what the error is in storage/logs/laravel.log

Thanks for the reply, as i have backup of v5.3.66, so i restore back to that version.

Then i redo back the step as follows;

  1. Upgrade via internal app upgrade (Then error 500 occured)
  2. Download the latest 5.3.73
  3. Via cpanel i upload the latest version and Rewrite (instead of my earlier step where i deleted the old installation)
  4. Run artisan optimize

Seems everything worked as it should. Thanks for your hardwork sir :smile:

But i didnt run the /update?secret=secret is it okey to not do that? and what is this command should do to the installation?

1 Like

@NoobKS92

the /update?secret=secret may/may not be needed. it just guarantees the config is updated.

Thanks, this update has broken my install as well, but due to this thread and @NoobKS92 steps, I was able to get everything running quickly.
Here are my steps for ubuntu install:

cd /usr/share/nginx/
sudo mv invoiceninja invoiceninja.bc
sudo wget https://github.com/invoiceninja/invoiceninja/releases/download/v5.3.73/invoiceninja.zip -O invoiceninja.zip
sudo unzip invoiceninja.zip -d ./invoiceninja
sudo cp ./invoiceninja.bc/.env ./invoiceninja
sudo cp -r ./invoiceninja.bc/public/storage ./invoiceninja/public
sudo chown -R www-data:www-data invoiceninja
sudo chmod -R 777 invoiceninja
php ./invoiceninja/artisan optimize
sudo reboot

In summary, moved the old install root to a .bc directory
downloaded and unzipped the latest version
coped .env and storage from the old directory to the new
chmod and chown the new directory as needed
run optimize and rebooted

back up and running. :slight_smile:

P.S. Forgot to mention that I needed to reupload the company logo, as otherwise it would not show up on the PDFs.

3 Likes

Just wanted to echo that I found this thread after updating through the app. My steps to get it fixed were:

Thanks all for a quick response on this.

5.3.68 to 5.3.73. It didn’t work when writing into the existing folder so I and had to move the existing install to a backup folder. Missed copying invoice documents/logo but otherwise Gene’s steps were perfect thanks.

sudo cp -R ./invoiceninja.bc/public/storage ./invoiceninja/public

Same here when updating from .68 to .74.
I downloaded - as with every update - invoiceninja-5.3.74.zip and manually uploaded the files with FTP. I don’t have sudo access to the shared hosting and can’t therefore perform the steps suggested by @NoobKS92 and @gene.

[2022-03-19 00:05:21] production.INFO: updating currencies  
[2022-03-19 06:00:36] production.INFO: Performing Autobilling 2022-03-19 06:00:36  
[2022-03-19 11:33:11] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:34:14] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:35:21] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:35:21] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:36:13] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:37:12] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:38:13] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:39:11] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:40:26] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:40:26] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:41:12] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:42:14] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:43:10] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:44:14] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:45:25] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:45:25] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:45:31] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:45:31] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:45:32] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:45:53] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:45:58] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:46:13] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:47:13] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:48:14] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:49:10] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:50:26] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:50:26] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:51:11] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:52:14] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:53:10] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:54:14] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:54:41] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:54:41] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"} 
[2022-03-19 11:54:50] 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/4a/0/02ec6ee49d/public_html/invoiceninja-v5/app/Models/Company.php:29)
[stacktrace]
#0 {main}
"}

In my step, im simply upload the files to the invoice ninja directory, then extract the files there, which the system usually gonna replace any existing files that matches the files within the invoice ninja zip files. Im using shared, where hosting doesn’t allowed for me to use sudo too.

1 Like

@NoobKS92
Thanks!

Did you upload the 216MB file, or the source code zip? I used - as always - the source code zip.

I use the first 1, “invoiceninja.zip”

1 Like

Sudo can be omitted in shared environment where everything is running as the same user.

1 Like

Seems you’ve tried fixing the install using the source code download, which doesn’t include the vendor files.

This seems to be the case I found as well and here are the corrective steps I took to get my systems back online

1 Like

Hey @gene
Yes, I first downloaded and installed the source code file, but that didn’t work. Then I downloaded the full file including the vendor files but also got an error 500.

@amp51 my IN installations usually break (on two completely different shared hostings) when I do php artisan optimize. No idea why…

However, I think it should be possible to udpate InvoiceNinja without manual fixes via command line…

What is the command output while trying optimize? Also what is the error log have while trying the webui?

Also useful: run the ls -la command in the root invoiceninja directory. What is the output?

@gene
Thanks for your reply!
That’s the error log: IN5 error log - Pastebin.com
Regarding php artisan optimize: As far as I remember nothing special.
In the meantime, I went back to v5.3.68-W77 using a backup. I’m using InvoiceNinja in my productive workflow, so I cannot risk a completely destroyed installation…

Running composer update fixed this for me.

Just tried to upgrade from v 5.3.68-W77 to v5.3.7.75 and had the same thing happen. Which brought me here. I restored and will try the manual update. Fingers crossed! Thanks for the tip.

deleting the content of /bootstrap/cache worked for me.

1 Like