Cant enable maintenance mode

I’m running Nextcloud 10 on Ubuntu 14.04 server. Want to upgrade to Nextcloud 11, but requires php 5.6 at minimum. After upgrading from php 5.5. to 5.6, Nextcloud web interface continued to function properly and thought I was all set to move forward with Nextcloud updates. However, when I proceeded to enable Nextclound Maintenance Mode (as seen below), but received error messages. I thought of editing the config.php but afraid it may cause a deeper issues and render the server inaccessible. Thank you for your support.

Update: Also want to mention that I am running Nextcloud 10.0.0, however, Ive been receiving an update notice saying owncloud 9.1.2 is now available.

root@cloudserver:/var/www/html/nextcloud# sudo -u www-data php occ maintenance:mode --on
An unhandled exception has been thrown:
Error: [] operator not supported for strings in /var/www/html/nextcloud/lib/private/App/InfoParser.php:187
Stack trace:
#0 /var/www/html/nextcloud/lib/private/App/InfoParser.php(189): OC\App\InfoParser->xmlToArray(Object(SimpleXMLElement))
#1 /var/www/html/nextcloud/lib/private/App/InfoParser.php(60): OC\App\InfoParser->xmlToArray(Object(SimpleXMLElement))
#2 /var/www/html/nextcloud/lib/private/legacy/app.php(678): OC\App\InfoParser->parse('/var/www/html/n...')
#3 /var/www/html/nextcloud/lib/private/legacy/app.php(650): OC_App::getAppInfo('/var/www/html/n...', true)
#4 /var/www/html/nextcloud/lib/private/legacy/app.php(637): OC_App::getAppVersionByPath('/var/www/html/n...')
#5 /var/www/html/nextcloud/lib/private/legacy/app.php(1003): OC_App::getAppVersion('files')
#6 /var/www/html/nextcloud/lib/private/legacy/util.php(1458): OC_App::shouldUpgrade('files')
#7 /var/www/html/nextcloud/lib/public/Util.php(708): OC_Util::needUpgrade(Object(OC\AllConfig))
#8 /var/www/html/nextcloud/lib/base.php(324): OCP\Util::needUpgrade()
#9 /var/www/html/nextcloud/lib/base.php(710): OC::checkUpgrade(false)
#10 /var/www/html/nextcloud/lib/base.php(1043): OC::init()
#11 /var/www/html/nextcloud/console.php(48): require_once('/var/www/html/n...')
#12 /var/www/html/nextcloud/occ(11): require_once('/var/www/html/n...')
#13 {main}root@cloudserver/var/www/html/nextcloud#

Looks like the php version on command line is a bit old. Can you check with php --version?

For Nextcloud, I would consider upgrading to Ubuntu 16.04, php 7 is much faster and all the caching modules can be used (no backports or 3rd-party).

tflidd- Thanks for the reply. the php -v gives the below version. Running Ubuntu 14.04.

Should I a2dismod php5.6 and then a2enmod php7.1 to fix this issue?

PHP 7.1.1-1+deb.sury.org~trusty+1 (cli) (built: Jan 20 2017 09:43:29) ( NTS )
Copyright © 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright © 1998-2017 Zend Technologies
with Zend OPcache v7.1.1-1+deb.sury.org~trusty+1, Copyright © 1999-2017, by Zend Technologies

I would use php 5.6 or php 7.0. Not sure if 7.1 is already fully supported (they are working on it but there might be still some bugs). If you run from command line, it is independent from which modules you load in apache, so check where your php 5.6 or php 7.0 binaries are.

tflidd -

I want to clarify that when running php -v it lists the highest version installed on Ubuntu which is 7.1. Php versions installed include 5.5, 5.6, 7.0 and 7.1. Current version apache is using is 5.6. Are you saying enabling php 7.0 will resolve the above issue im having? Also, should I remove older versions installed?

Lastly, I would like to know if editing the config/config.php to enable maint mode would cause issue since using the command line is throwing errors?

Thank you,

larkski

So was able to resolve my issue by spinning up a new Ubuntu 16.04 server with PHP7. Moved data directory, mysql database and nextcloud code directory to new server. All is fine now. Thanks!

This topic was automatically closed after 24 hours. New replies are no longer allowed.