Migration owncloud 9.0.4 to fails with could not acquire a shared lock on the config file

I’m trying to upgrade my current owncloud 9.0.4 installation to nextcloud 10.

I essentially followed the basic steps (moved /var/www/owncloud away, created /var/www/owncloud new, copied data, config, .htaccess and .user.ini, downloaded nextcloud 10, copied into /var/www/owncloud, changed permissions). When I then run

/var/www/owncloud# sudo -u www-data php occ upgrade

I get:

An unhandled exception has been thrown:
Exception: Could not acquire a shared lock on the config file /var/www/owncloud/config/config.php in /var/www/owncloud/lib/private/Config.php:199
Stack trace:
#0 /var/www/owncloud/lib/private/Config.php(59): OC\Config->readData()
#1 /var/www/owncloud/lib/base.php(129): OC\Config->__construct('/var/www/ownclo...')
#2 /var/www/owncloud/lib/base.php(574): OC::initPaths()
#3 /var/www/owncloud/lib/base.php(1043): OC::init()
#4 /var/www/owncloud/console.php(48): require_once('/var/www/ownclo...')
#5 /var/www/owncloud/occ(11): require_once('/var/www/ownclo...')
#6 {main}

Not sure what that means. config.php permissions look ok to me:

root@server642:/var/www/owncloud# ls -l /var/www/owncloud/config/config.php
-rw-r----- 1 www-data www-data 1056 Sep  1 10:10 /var/www/owncloud/config/config.php

Have you remove all old code before (only keep data/ and config/-folder)?

Yep, as said above, I started by moving the old owncloud directory away entirely, and then only copied the mentioned dirs/files back.

Strange, normally this is a permission issue. www-data can write in folder config/?


:/var/www/owncloud/config# ls -la
insgesamt 55
drwxr-x---  2 www-data www-data     6 Sep  1 14:23 .
drwxr-x--- 16 root     www-data    31 Sep  1 10:35 ..
-rw-r-----  1 www-data www-data  1430 Sep  1 14:23 config.php
-rw-r-----  1 www-data www-data 40317 Aug 25 05:59 config.sample.php
-rw-r-----  1 www-data www-data   105 Sep  1 10:10 disable-updatechecker.config.php
-rw-r-----  1 www-data www-data   225 Sep  1 10:10 .htaccess

Looks good. Slowly running out of ideas. On the terminal you have a current php5.4+?
sudo -u www-data php --version
or perhaps some required modules are missing or are not activated in the cli-version (compare /etc/php*/cli with /etc/php*/apache2

If that doesn’t help, open a bug report on github.com/nextcloud/server/issues, you can link the post here and the other thread from owncloud.

Ubuntu 16.04 comes with PHP7:

PHP 7.0.8-0ubuntu0.16.04.2 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.8-0ubuntu0.16.04.2, Copyright (c) 1999-2016, by Zend Technologies

I’d be surprised, if PHP modules were part of the issue, as owncloud was running, and PHP requirements should be similar… Will check that later in detail.

Did this ever get resolved? I’m just curious, it is a weird error :wink: