I an trying to update nextcloud from 9.0.53. I downloaded the tar.bz2, extracted and renamed it to the correct name folder, and move the data directorie and the config.php file to the new folder. When I run
sudo -u www-data php nextcloud/occ upgrade
I receive the fowling messages and error.
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Set log level to debug
Turned on maintenance mode
Checking whether the database schema can be updated (this can take a long time depending on the database size)
Checked database schema update
Checking updates of apps
Checked database schema update for apps
Updating database schema
Updated database
Updating <theming> ...
Updated <theming> to 0.2.0
Starting code integrity check...
Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'INSERT INTO `oc_appconfig` (`appid`,`configkey`,`configvalue`) SELECT ?,?,? FROM `oc_appconfig` WHERE `appid` = ? AND `configkey` = ? HAVING COUNT(*) = 0' with params ["core", "oc.integritycheck.checker", "[]", "core", "oc.integritycheck.checker"]:
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
Update failed
Maintenance mode is kept active
Reset log level
The Mysql server is a remote MariaDB server, running few other databases. As this is the first time we have problem with the db server, I thought you experts could give us some tips about what we should look for. Any help will be appreciated.
If you want other variables values, please ask. I had played with those values myself with no results and I can test whatever you want. BUT I also read that problem could be a improper query and this motivated me to ask you experts. Interesting is no errors show up in the mysql error log. Thanks again.
www-data@nextcloud:/var/www/html/nextcloud$ php occ upgrade
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Set log level to debug
Checking whether the database schema can be updated (this can take a long time depending on the database size)
Done
27/27 [============================] 100%
Checked database schema update
Checking updates of apps
Checking whether the database schema for <activity> can be updated (this can take a long time depending on the database size)
Done
2/2 [============================] 100%
Checking whether the database schema for <dav> can be updated (this can take a long time depending on the database size)
Done
10/10 [============================] 100%
Checking whether the database schema for <federatedfilesharing> can be updated (this can take a long time depending on the database size)
Done
1/1 [============================] 100%
Checking whether the database schema for <federation> can be updated (this can take a long time depending on the database size)
Done
1/1 [============================] 100%
Checking whether the database schema for <files_sharing> can be updated (this can take a long time depending on the database size)
Done
1/1 [============================] 100%
Checking whether the database schema for <files_trashbin> can be updated (this can take a long time depending on the database size)
Done
1/1 [============================] 100%
Checking whether the database schema for <notifications> can be updated (this can take a long time depending on the database size)
Done
1/1 [============================] 100%
Checking whether the database schema for <user_ldap> can be updated (this can take a long time depending on the database size)
Done
3/3 [============================] 100%
Checked database schema update for apps
Updating database schema
Updated database
Updating <federatedfilesharing> ...
Updated <federatedfilesharing> to 1.0.1
Updating <gallery> ...
Updated <gallery> to 15.0.1
Updating <provisioning_api> ...
Updated <provisioning_api> to 1.0.0
Updating <theming> ...
Updated <theming> to 1.0.1
Updating <updatenotification> ...
Updated <updatenotification> to 1.0.1
Updating <federation> ...
Updated <federation> to 1.0.1
Updating <user_ldap> ...
Updated <user_ldap> to 1.0.1
Updating <files> ...
Updated <files> to 1.5.2
Updating <activity> ...
Updated <activity> to 2.3.2
Updating <dav> ...
Fix classification for calendar objects
Done
4/4 [============================] 100%
Updated <dav> to 1.0.1
Updating <files_sharing> ...
Updated <files_sharing> to 1.0.0
Updating <files_trashbin> ...
Updated <files_trashbin> to 1.0.0
Updating <files_versions> ...
Updated <files_versions> to 1.3.0
Updating <comments> ...
Updated <comments> to 1.0.0
Updating <notifications> ...
Updated <notifications> to 0.3.0
Updating <systemtags> ...
Updated <systemtags> to 1.0.2
Drop old database tables
Done
31/31 [============================] 100%
Remove old (< 9.0) calendar/contact shares
Done
4/4 [============================] 100%
Fix permissions so avatars can be stored again
Done
2/2 [============================] 100%
Repair unmerged shares
Done
4/4 [============================] 100%
Starting code integrity check...
Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'INSERT INTO `oc_appconfig` (`appid`,`configkey`,`configvalue`) SELECT ?,?,? FROM `oc_appconfig` WHERE `appid` = ? AND `configkey` = ? HAVING COUNT(*) = 0' with params ["core", "oc.integritycheck.checker", "[]", "core", "oc.integritycheck.checker"]:
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
Update failed
Maintenance mode is kept active
Reset log level
You allow persistant connections, so it shouldn’t be a problem of a php timeout. In my.cnf you can change the settings as well (at least during the upgrade): https://support.rackspace.com/how-to/how-to-change-the-mysql-timeout-on-a-server/
other solution could be that you enable reconnect in you php.ini: mysqli.reconnect = On
What kind of a system are you using and how many users and data? Just to check, for smaller setups on real systems you normally don’t need many adjustments, only on larger setups or limited hardware.
For more details, you could enhance the loglevel of your servers (webserver, php and mysql), then you should be able to figure out which process run into a timeout.