PHP upgrade breaks owncloud

I have upgraded to owncloud 10.3.1 from 10.2.1 and all is still working smooth as always. My server environment is CentOS Linux release 7.7.1908. I have fully updated my server from yum update with the exception of php because if I update php it breaks the owncloud webinterface. My webserver is currently nginx.

Below is the output of yum update that shows my current version of php and the new version that is trying to upgrade to. Essentially I am already running php-7.2.20-1 but just upgrading to a newer revision of php-7.2.24-1

Once I update php and restart the nginx web server I then try to open the owncloud webpage and receive an internal error.

Has anyone else run into this issue? What am I missing that causes this minor php revision upgrade to break the owncloud web interface?

Thanks for any insight you may provide.

Adam,

could you please provide the exception as logged in owncloud.log when you try to open the webpage? Only then we could read what actually happened - maybe this is only a little thing to fix.

ownCloud 10.3.1 IS working with php 7.2, so the version upgrade this is not the issue, in most cases one or more php modules are missing.

1 Like

Hi Cortho,

I will provide the output of this log file later today. I will need to upgrade php after hours. In the meantime below is the modules that are currently installed and being upgrade per yum update for php.

php x86_64 7.2.24-1.el7.remi
php-cli x86_64 7.2.24-1.el7.remi
php-common x86_64 7.2.24-1.el7.remi
php-fpm x86_64 7.2.24-1.el7.remi
php-gd x86_64 7.2.24-1.el7.remi
php-intl x86_64 7.2.24-1.el7.remi
php-json x86_64 7.2.24-1.el7.remi
php-ldap x86_64 7.2.24-1.el7.remi
php-mbstring x86_64 7.2.24-1.el7.remi
php-mysqlnd x86_64 7.2.24-1.el7.remi
php-pdo x86_64 7.2.24-1.el7.remi
php-pear noarch 1:1.10.10-1.el7.remi
php-pecl-mcrypt x86_64 1.0.3-1.el7.remi.7.2
php-pecl-zip x86_64 1.15.5-1.el7.remi.7.2
php-process x86_64 7.2.24-1.el7.remi
php-xml x86_64 7.2.24-1.el7.remi

Good morning. Please see below the error that is generated in owncloud.log after upgrading php.

{“reqId”:“a29WBPzfjqvhWviRZVxQ”,“level”:3,“time”:“2019-11-21T12:13:00+00:00”,“remoteAddr”:“172.18.2.241”,“user”:"–",“app”:“index”,“method”:“GET”,“url”:"/",“message”:“Exception: {“Exception”:“OCP\\Session\\Exceptions\\SessionNotAvailableException”,“Message”:”",“Code”:0,“Trace”:"#0 \/usr\/share\/nginx\/html\/owncloud\/lib\/private\/Session\/CryptoSessionData.php(159): OC\\Session\\Internal->getId()\n#1 \/usr\/share\/nginx\/html\/owncloud\/lib\/private\/User\/Session.php(750): OC\\Session\\CryptoSessionData->getId()\n#2 \/usr\/share\/nginx\/html\/owncloud\/lib\/base.php(450): OC\\User\\Session->invalidateSessionToken()\n#3 \/usr\/share\/nginx\/html\/owncloud\/lib\/base.php(587): OC::initSession()\n#4 \/usr\/share\/nginx\/html\/owncloud\/lib\/base.php(1005): OC::init()\n#5 \/usr\/share\/nginx\/html\/owncloud\/index.php(53): require_once(’\/usr\/share\/ngin…’)\n#6 {main}",“File”:"\/usr\/share\/nginx\/html\/owncloud\/lib\/private\/Session\/Internal.php",“Line”:130}"}

I found the issue and wanted to post in case someone else runs into this. After looking up the error in the log file “SessionNotAvailableException” it lead me to wrong permissions on the php sessions folder. When php was updated it reset the permissions on the session folder which in CentOS 7 is located at: /var/lib/php/session. By default the permission was root:apache so I changed it root:nginx. This solved the issue and owncloud is back in operation.

Adam

3 Likes

Congratulations Adam and thank you very much for sharing your solution. This sure will help other members, when they are stuck.

And again we see, reading owncloud.log is inevitable when solving issues :wink:

I am glad, your ownCloud is back.

1 Like

Hey,

this looks to me like a bug in the CentOS PHP packages. I think it could make sense to do a bugreport for the CentOS project to avoid such situations in the future.