Cannot upgrade from 5.3.25 to 5.5.x

My Environment:
Ubuntu Server 20.04.4
Nginx
mariadb
pdf generator - snappdf
PHP 8.1.9
Original V5 install was via zip file.
I verified ALL files in /usr/share/nginx/invoiceninja and subdirectories have the correct owner/group, including dotfiles.

Everything was working fine when I started. My 5.3.25 seems stable after upgrading to PHP 8.1.9. I am using snapshots and I am able to roll back my upgrade attempts to my stable install. I have tried several times with different methods. (both GUI and downloading the latest zip) This latest attempt was via the GUI.

Once I hit the upgrade button, I get a 500 error with pretty much anything I do. if I clear the laravel log prior to upgrade attempt, it remains empty. I am getting PHP errors, detailed below.

I tried php artisan optimize from the command line (php -v shows 8.1.9 from the cli) and got basically the same errors as were in my nginx error log for when I tried to access the site. This is the output from the command line:

PHP Warning: Trying to access array offset on value of type null in /usr/share/nginx/invoiceninja/vendor/laravel/framework/src/Illuminate/Support/Facades/Schema.php on line 49
PHP Fatal error: Uncaught Error: Call to a member function connection() on null in /usr/share/nginx/invoiceninja/vendor/laravel/framework/src/Illuminate/Support/Facades/Schema.php:49
Stack trace:
#0 /usr/share/nginx/invoiceninja/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(166): Illuminate\Support\Facades\Schema::getFacadeAccessor()
#1 /usr/share/nginx/invoiceninja/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(255): Illuminate\Support\Facades\Facade::getFacadeRoot()
#2 /usr/share/nginx/invoiceninja/app/Exceptions/Handler.php(79): Illuminate\Support\Facades\Facade::__callStatic()
#3 /usr/share/nginx/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(366): App\Exceptions\Handler->report()
#4 /usr/share/nginx/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(131): Illuminate\Foundation\Console\Kernel->reportException()
#5 /usr/share/nginx/invoiceninja/artisan(37): Illuminate\Foundation\Console\Kernel->handle()
#6 {main}
thrown in /usr/share/nginx/invoiceninja/vendor/laravel/framework/src/Illuminate/Support/Facades/Schema.php on line 49

Hi,

@david do you have any suggestions?

Couple of things to try here:

  1. Remove the contents of bootstrap/cache
  2. run composer i -o --no-dev

If this doesn’t work, you’ll want to download the latest release from here Release v5.5.15 · invoiceninja/invoiceninja · GitHub

and overwrite your files

I tried the above again. I cleared the bootstrap/cache and made sure to run the composer i -o --no-dev under the context of www-data user. I still got the same error in the logs.

I then downloaded the 5.5.15 zip file and unzipped it into my invoiceninja directory. Now the page starts to load, but I am stuck at a spinning circle animation. The nginx error log is empty. The laravel.log has nothing also. Here are the nginx access log entries:

10.1.254.254 - - [25/Aug/2022:05:03:00 +0000] "GET / HTTP/1.1" 200 1881 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:103.0) Gecko/20100101 Firefox/103.0"
10.1.254.254 - - [25/Aug/2022:05:03:00 +0000] "GET /js/pdf.min.js HTTP/1.1" 200 65554 "https://redacted.my.invoiceninja/" "Mozilla/5.0 (X11; Linux x86_64; rv:103.0) Gecko/20100101 Firefox/103.0"
10.1.254.254 - - [25/Aug/2022:05:03:00 +0000] "GET /main.foss.dart.js?v=5.5.15 HTTP/1.1" 200 3196726 "https://redacted.my.invoiceninja/" "Mozilla/5.0 (X11; Linux x86_64; rv:103.0) Gecko/20100101 Firefox/103.0"
10.1.254.254 - - [25/Aug/2022:05:03:01 +0000] "GET /canvaskit/canvaskit.js HTTP/1.1" 200 44666 "https://redacted.my.invoiceninja/" "Mozilla/5.0 (X11; Linux x86_64; rv:103.0) Gecko/20100101 Firefox/103.0"
10.1.254.254 - - [25/Aug/2022:05:03:01 +0000] "GET /canvaskit/canvaskit.wasm HTTP/1.1" 200 6953528 "https://redacted.my.invoiceninja/" "Mozilla/5.0 (X11; Linux x86_64; rv:103.0) Gecko/20100101 Firefox/103.0"
10.1.254.254 - - [25/Aug/2022:05:03:01 +0000] "GET /assets/assets/google_fonts/Roboto-Regular.ttf HTTP/1.1" 200 168260 "https://redacted.my.invoiceninja/" "Mozilla/5.0 (X11; Linux x86_64; rv:103.0) Gecko/20100101 Firefox/103.0"
10.1.254.254 - - [25/Aug/2022:05:03:01 +0000] "POST /api/v1/refresh?&first_load=true&include_static=true HTTP/1.1" 500 44 "https://redacted.my.invoiceninja/" "Mozilla/5.0 (X11; Linux x86_64; rv:103.0) Gecko/20100101 Firefox/103.0"
10.1.254.254 - - [25/Aug/2022:05:03:01 +0000] "POST /api/v1/refresh?&first_load=true&include_static=true HTTP/1.1" 500 44 "https://redacted.my.invoiceninja/" "Mozilla/5.0 (X11; Linux x86_64; rv:103.0) Gecko/20100101 Firefox/103.0"
10.1.254.254 - - [25/Aug/2022:05:03:01 +0000] "GET /assets/assets/images/icon.png HTTP/1.1" 200 7360 "https://redacted.my.invoiceninja/" "Mozilla/5.0 (X11; Linux x86_64; rv:103.0) Gecko/20100101 Firefox/103.0"

I am not sure of the consequences, but I think I am going to try renaming my installation, unzipping a fresh copy, then move my .env file over. Not sure if I will need to do anything else.

Update: I removed my invoiceninja folder and installed a fresh instance into an empty directory, then copied my .env over, and I am still stuck at the spinning circle where the two POST entries in the access log are giving a 500 error.