Im getting a error 500 when trying to connect to my server

To confirm. It was working fine for a few days before it suddenly died.

I tried sudo composer install --no-dev incase it was a dependency issue. It returns with the below.

Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Nothing to install, update or remove
Generating optimized autoload files
Illuminate\Foundation\ComposerScripts::postAutoloadDump
@php artisan package:discover --ansi
PHP Notice: 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 45
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:45
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(75): 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}
in /usr/share/nginx/invoiceninja/vendor/laravel/framework/src/Illuminate/Support/Facades/Schema.php on line 45
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255

Within the error log i get

#4 /usr/share/nginx/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(112): Illuminate\Foundation\Http\Kernel->reportException()
#5 /usr/share/nginx/invoiceninja/public/index.php(57): Illuminate\Found" while reading response header from upstream, client: 10.0.0.4, server: removed, request: “GET / HTTP/2.0”, upstream: “fastcgi://unix:/run/php/php-fpm.sock:”, host: “remvoed”
2021/06/09 15:14:59 [error] 25590#25590: *1 FastCGI sent in stderr: “PHP message: PHP Notice: 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 45PHP message: 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:45
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(75): Illuminate\Support\Facades\Facade::__callStatic()
#3 /usr/share/nginx/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(414): App\Exceptions\Handler->report()
#4 /usr/share/nginx/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(112): Illuminate\Foundation\Http\Kernel->reportException()
#5 /usr/share/nginx/invoiceninja/public/index.php(57): Illuminate\Found” while reading response header from upstream, client: 10.0.0.4, server: removed, request: “GET /?revision=23224b5e03519aaa87594403d54412cf HTTP/2.0”, upstream: “fastcgi://unix:/run/php/php-fpm.sock:”, host: “remvoed”, referrer: “https:/removed/flutter_service_worker.js?v=5.1.70”
2021/06/09 15:16:12 [error] 25590#25590: *10 FastCGI sent in stderr: “PHP message: PHP Notice: 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 45PHP message: 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:45
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(75): Illuminate\Support\Facades\Facade::__callStatic()
#3 /usr/share/nginx/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(414): App\Exceptions\Handler->report()
#4 /usr/share/nginx/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(112): Illuminate\Foundation\Http\Kernel->reportException()
#5 /usr/share/nginx/invoiceninja/public/index.php(57): Illuminate\Found” while reading response header from upstream, client: 10.0.0.4, server: removed, request: “GET / HTTP/2.0”, upstream: “fastcgi://unix:/run/php/php-fpm.sock:”, host: “removed”
2021/06/09 15:16:13 [error] 25590#25590: *10 FastCGI sent in stderr: “PHP message: PHP Notice: 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 45PHP message: 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:45
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(75): Illuminate\Support\Facades\Facade::__callStatic()
#3 /usr/share/nginx/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(414): App\Exceptions\Handler->report()
#4 /usr/share/nginx/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(112): Illuminate\Foundation\Http\Kernel->reportException()
#5 /usr/share/nginx/invoiceninja/public/index.php(57): Illuminate\Found” while reading response header from upstream, client: 10.0.0.4, server: removed, request: “GET /?revision=23224b5e03519aaa87594403d54412cf HTTP/2.0”, upstream: “fastcgi://unix:/run/php/php-fpm.sock:”, host: “removed”, referrer: “https://removed/flutter_service_worker.js?v=5.1.70

Hi,

It looks like there may be a problem with the database connection.

@david any ideas to debug?

Indicates a database issue. either an extension missing or something to do with the system not being able to connect to the database.

you may get more information from the system by trying to boot up tinker

php artisan tinker

This may give more clues.

For anyone that lands here, the most likely cause of this is a rogue config file which is corrupting the config build

running

git clean -ifx

will show any files in the repo which may be interfering.