octobercms / october

Self-hosted CMS platform based on the Laravel PHP Framework.
https://octobercms.com/
Other
11.03k stars 2.21k forks source link

October upgrade from 419 to 428 #3268

Closed chrisvidal closed 6 years ago

chrisvidal commented 6 years ago
Expected behavior

a proper upgrade to the latest build

Actual behavior

Update failed

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> 500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, you@example.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Reproduce steps

upgrade the system page and confirm the upgrade

October build

419

ametad commented 6 years ago

Major changes in OC updates can lead to these errors. Please read http://octobercms.com/support/article/rn-9

Perhaps one of the plugins you use is not compatible with the changes?

Or:

Known issues First update fails: When updating to Build 420 via the backend, the first update will fail with message Update failed. Simply refresh the page and run the update process a second time.

LukeTowers commented 6 years ago

@chrisvidal what was the information available in the server logs?

angelodmrch commented 6 years ago

I had the same issue, in my case the problem was that I still running with PHP 5.6 , updating to PHP 7.1 solve it.

Samorai commented 6 years ago

@LukeTowers I had try to update from 419 to 428, and got 500 internal server error. Into server logs had:

PHP message: PHP Fatal error:  Uncaught Error: Class 'Predis\Client' not found in *********/vendor/laravel/framework/src/Illuminate/Redis/Connectors/PredisConnector.php:25

But I have QUEUE_DRIVER=redis

Steps to fix it:

  1. Change env variables to
    CACHE_DRIVER=array
    QUEUE_DRIVER=file
    SESSION_DRIVER=file
  2. Update build
  3. composer require predis/predis
  4. Change back env variables, if you're using Redis.

@chrisvidal can you give your .env file?

LukeTowers commented 6 years ago

@Samorai don't add dependencies to your project's composer.json, use the Drivers plugin instead. I have no idea how your site was working without it and using redis before. http://octobercms.com/plugin/october-drivers

chrisvidal commented 6 years ago

OK I got it. OC does mot upgrade if you are trying to upgrade the plugins RainLab.User at the same time. So, skip the upgrade of RainLab.user first. Perform OC upgrade. Then perform upgrade of RainLab.User and it should work

thanks All

Samorai commented 6 years ago

@LukeTowers ok, thanks. I have many dependencies which I added to composer.json, now I'll moving it to Drivers plugin.

LukeTowers commented 6 years ago

@Samorai if your dependencies aren't included in the drivers plugin don't add them yourself. Read https://luketowers.ca/blog/how-to-use-laravel-packages-in-october-cms-plugins/

gregorskii commented 6 years ago

I have this same issue. Should the updater be smart and know that it cannot update to a version that requires a different PHP version that the system supports? Seems like a bad practice to bomb the system when the admins have not installed PHP 7.

I would imagine it would update to the last version which supports the PHP version the system is on, which is version 1.0.419.

I have explicitly installed 419 in my vagrant install. I can't even attach a project without the server bombing with a 500.

LukeTowers commented 6 years ago

@gregorskii could you detail exactly what is occurring to "bomb the system"?

gregorskii commented 6 years ago

Before I update everything is fine, after server 500s every request. The update fails with a 500 as well.

I would have to rebuild the system to grab the exact error.

The server stack in question is using php 5.7.

Here are the errors:


// ERROR from update
2018/01/06 22:48:25 [error] 14301#0: *37 FastCGI sent in stderr: "PHP message: PHP Parse error:  syntax error, unexpected '?' in /var/www/APP/october/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 233" while reading response header from upstream, client: 192.168.33.1, server: APP, request: "GET /backend/system/updates HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "APP"

// ERRORS after
192.168.33.1 - - [06/Jan/2018:22:40:08 +0000] "POST /backend/system/updates HTTP/1.1" 500 5 "http://APP/backend/system/updates" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36"
192.168.33.1 - - [06/Jan/2018:22:40:09 +0000] "GET /backend/system/updates HTTP/1.1" 500 5 "http://APP/backend/system/settings" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36"
LukeTowers commented 6 years ago

So you've installed 419 and it's erroring when you try to attach a project?

gregorskii commented 6 years ago

Yes, server does not have php 7 so I can not install anything newer.

LukeTowers commented 6 years ago

@gregorskii when you tried to update to build >=420, you should have had to manually confirm the new requirements of PHP7: https://octobercms.com/changelog

gregorskii commented 6 years ago

It will work without it 7.0, assuming one follows the instructions and fixes the known issues? Also I did not try to update the second time, I just tried to attach the project, does that trigger an update as well?

LukeTowers commented 6 years ago

@gregorskii attaching a project will trigger an update to grab the plugins associated with the project. However, it's not going to serve you outdated versions of plugins that are compatible with 419.

I cannot understate how much I recommend that you simply update to at least PHP 7 given the performance and security improvements in general of 7 and the fact that you will be missing out on any future security or performance improvements in October, not to mention bug fixes and future features. We will not be backporting any fixes for 419, so I highly recommend you upgrade to PHP 7 so that you can remain stable on this LTS release of Laravel.

gregorskii commented 6 years ago

Understood that is my goal too, we manage quite a lot of projects and this is not one of mine. I am updating a related system and getting pulled into a world of hurt here. :)

I'll update it and let you know what I find.

gregorskii commented 6 years ago

Think I was able to update PHP 7 in this projects Vagrant install.

Ran into #3321.

LukeTowers commented 6 years ago

@gregorskii that's not a huge issue, just rerun php artisan key:generate after running php artisan october:env

gregorskii commented 6 years ago

Yes, but the issue is it fails on composer new. That’s how the ansible job is creating the instance.

gregorskii commented 6 years ago

Done. I had a few things I had to update:

cipher type, update the APP_KEY to new cipher used locked composer.json file which removes the post install command to generate the key -> rather than using composer new to create a new october project in the container install php7.2-zip updated configs to .env type removing most custom configs in config/ (not required, but seems to make sense) lots of other vagrant and ansible changes specific to this environment

Thanks for the help :)

LukeTowers commented 6 years ago

Not a problem @gregorskii, glad I could help you update!