Update from 3.8 via latest git code: HTTP 500 error when loading /public/update

Dear InvoiceNinja Team,

I’ve run an update via the most recent git repo code (branch origin/master), followed by the composer update/install:

i) PHP 7.0.26 up and running, apache2, mysql db
ii) no errors during the composer update
iii) have updated the key: php artisan ninja:update-key --legacy=true
iv) also cleared the cache a couple of times when loading /public/update
v) no errors in apache2 log
v) also tried to install via shell skript (https://pastebin.com/j657uv9A) instead of the git code:
The shell update process seems to break at the same stage:
<<< printf ‘Running update migration commands (%s/update)…\n\n’ “$app_url”
wget -q --spider “$app_url/update” >>>

  • since the final printf is not executed

I would greatly appreciate your advice.

Many thanks!
Ingo

Are there details about the error in the web server logs?

Note: you should run ‘composer install’ not ‘composer update’

Unfortunately, there are no details about this error in the apache log.

Thanks for pointing out, I’ve run .composer install, though it says nothing to install or update.

I’ve also checked the /public/.htaccess:

RewriteBase /

was commented out already.

If there’s no way to fix this, would you advise to set up a clean, new installation and migrate/restore the existing db?
If yes, are there any best practice hints for this?

Thanks a lot indeed.
Ingo

Maybe this will help to see the error details in the logs: https://stackoverflow.com/a/20511956/497368

If you use a clean install you’d want to use mysqldump to transfer the database and make sure to copy over the .env file.

The HTTP 500 php error points to:

“NOTICE: PHP message: PHP Fatal error: Uncaught ReflectionException: Class LaravelCrawlerDetect does not exist in /var/www/vhosts/MYDOMAIN.de/httpdocs/ninja/vendor/laravel/framework/src/Illuminate/Container/Container.php:749”
[28-Dec-2017 14:54:59] WARNING: [pool MYDOMAIN.de] child 25054 said into stderr: “Stack trace:”
[28-Dec-2017 14:54:59] WARNING: [pool MYDOMAIN.de] child 25054 said into stderr: “#0 /var/www/vhosts/MYDOMAIN.de/httpdocs/ninja/vendor/laravel/framework/src/Illuminate/Container/Container.php(749): ReflectionClass->__construct(‘LaravelCrawlerD…’)”
[28-Dec-2017 14:54:59] WARNING: [pool MYDOMAIN.de] child 25054 said into stderr: “#1 /var/www/vhosts/MYDOMAIN.de/httpdocs/ninja/vendor/laravel/framework/src/Illuminate/Container/Container.php(644): Illuminate\Container\Container->build(‘LaravelCrawlerD…’, Array)”
[28-Dec-2017 14:54:59] WARNING: [pool MYDOMAIN.de] child 25054 said into stderr: “#2 /var/www/vhosts/MYDOMAIN.de/httpdocs/ninja/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(709): Illuminate\Container\Container->make(‘LaravelCrawlerD…’, Array)”
[28-Dec-2017 14:54:59] WARNING: [pool MYDOMAIN.de] child 25054 said into stderr: “#3 /var/www/vhosts/MYDOMAIN.de/httpdocs/ninja/vendor/laravel/framework/src/Illuminate/Container/Container.php(1203): Illuminate\Foundation\Application->make(‘LaravelCrawlerD…’)”
[28-Dec-2017 14:54:59] WARNING: [pool MYDOMAIN.de] child 25054 said into stderr: “#4 /var/www/vhosts/MYDOMAIN.de/httpdocs/ninja/vendor/laravel/framework/src/Illuminate/…”

Would you have any advice on this?

Again, thanks a lot!
Ingo

Try commenting out the Crawler references in app/Exceptions/Handler.php

Thanks, done that.

The log now shows the error:

[28-Dec-2017 15:07:41] WARNING: [pool MYDOMAIN.de] child 25126 said into stderr: “Stack trace:”
[28-Dec-2017 15:07:41] WARNING: [pool MYDOMAIN.de] child 25126 said into stderr: “#0 /var/www/vhosts/MYDOMAIN.de/httpdocs/ninja/app/Libraries/Utils.php(410): Illuminate\Support\Facades\Facade::__callStatic(‘get’, Array)”
[28-Dec-2017 15:07:41] WARNING: [pool MYDOMAIN.de] child 25126 said into stderr: “#1 /var/www/vhosts/MYDOMAIN.de/httpdocs/ninja/app/Exceptions/Handler.php(74): App\Libraries\Utils::logError(’***Symfony\Comp…’)”
[28-Dec-2017 15:07:41] WARNING: [pool MYDOMAIN.de] child 25126 said into stderr: “#2 /var/www/vhosts/MYDOMAIN.de/httpdocs/ninja/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(79): App\Exceptions\Handler->report(Object(Symfony\Component\Debug\Exception\FatalThrowableError))”
[28-Dec-2017 15:07:41] WARNING: [pool MYDOMAIN.de] child 25126 said into stderr: “#3 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleException(Object(Symfony\Component\Debug\Exception\FatalThrowableError))”
[28-Dec-2017 15:07:41] WARNING: [pool MYDOMAIN.de] child 25126 said into stderr: “#4 {main}”
[28-Dec-2017 15:07:41] WARNING: [pool MYDOMAIN.de] child 25126 said into stderr: " thrown in /var/www/vhosts/MYDOMAIN.de/httpdocs/ninja/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php on…"
[28-Dec-2017 15:07:41] WARNING: [pool MYDOMAIN.de] child 25126 said into stderr: “NOTICE: PHP message: PHP Fatal error: Uncaught Error: Call to undefined method Illuminate\Support\Facades\Session::get() in /var/www/vhosts/MYDOMAIN.de/httpdocs/ninja/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:237”

Try deleting bootstrap/cache/services.php

Thanks, have deleted bootstrap/cache/services.php
Unfortunately, the error remains.

Would be grateful for any further hint.

Many thanks.

It may be related to permissions, you could try running chmod -R 777 storage and then chmod -R 755 storage to see if it helps,

Checked the permission settings you mentioned. Doesn’t solve the issue, unfortunately.

What I notice though: the content in /storage/version.txt is: 3.8.1, which was my version before update.
Shouldn’t that be a higher version number for the /public/update to start migration?

Any final try?

Many thanks.

Sorry, I’m out of ideas… maybe try with a clean install.

Never mind, thanks a lot indeed!

For migrating into a clean install, is there anything else except for the i) db dump and ii).env I would have to backup and move?

If you’re using the documents feature you’d also need to move them.

Thanks a lot, highly appreciate your support!