Nextcloud 13 PHP 7.1 MySQL 8 --> Error 500

Hello,

after lot of researching I’m giving up.
This is my config:

Nextcloud version 13.0.2.1
Operating system Centos 7
Apache/2.4.6
PHP 7.1.20

That configuration has been working properly. But it won’t work anymore giving a 500 error. Probably after a yum update in the system, but I can’t confirm that.

LOG:
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib64/php/modules/ixed.5.4.lin’ - /usr/lib64/php/modules/ixed.5.4.lin: undefined symbol: _zend_hash_index_update_or_next_insert in Un
known on line 0
An unhandled exception has been thrown:
Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2006] MySQL server has gone away in /var/www/html/web/public/nextcloud/lib/private/D
B/Connection.php:64
Stack trace:
#0 /var/www/html/web/public/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\DB\Connection->connect()
#1 /var/www/html/web/public/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#2 /var/www/html/web/public/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\DBAL\Connection->detectDatabasePlatform()
#3 /var/www/html/web/public/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\DBAL\Connection->getDatabasePlatform()
#4 /var/www/html/web/public/nextcloud/lib/private/DB/Connection.php(151): Doctrine\DBAL\Connection->setTransactionIsolation(2)
#5 /var/www/html/web/public/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\DB\Connection->__construct(Array, Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doct
rine\DBAL\Configuration), Object(Doctrine\Common\EventManager))
#6 /var/www/html/web/public/nextcloud/lib/private/DB/ConnectionFactory.php(152): Doctrine\DBAL\DriverManager::getConnection(Array, Object(Doctrine\DBAL\Configuration), Object(Doctrine\Common\EventM
anager))

config.php file:
‘instanceid’ => ‘xxxxxxxxxxxxxxxxxxxxxxx’,
‘passwordsalt’ => ‘xxxxxxxxxxxxxxxxxxxxxxxxxx’,
‘secret’ => ‘xxxxxxxxxxxxxxxxxxxxxx’,
‘trusted_domains’ =>
array (
0 => ‘mydomain.com’,
1 => ‘192.168.0.191’,
),
‘datadirectory’ => ‘/home/nextcloud_data’,
‘overwrite.cli.url’ => ‘http://backup.mydomain.com’,
‘dbtype’ => ‘mysql’,
‘version’ => ‘13.0.2.1’,
‘dbname’ => ‘nextcloud’,
‘dbhost’ => ‘127.0.0.1’,
‘dbport’ => ‘3306’,
‘dbtableprefix’ => ‘oc_’,
‘dbuser’ => ‘oc_admin’,
‘dbpassword’ => ‘xxxxxxxxxxxxxxxxxxxxxxx’,
‘logtimezone’ => ‘UTC’,
‘installed’ => true,
‘mail_from_address’ => ‘info’,
‘mail_smtpmode’ => ‘php’,
‘mail_domain’ => ‘mydomain.com’,
‘maintenance’ => false,
‘theme’ => ‘’,
‘loglevel’ => 0,
‘updater.secret’ => ‘xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx’,

Apache log
[Fri Jul 27 00:38:56.243947 2018] [php7:error] [pid 18649] [client 81.37.209.47:29035] PHP Fatal error: Uncaught Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occu
red in driver: SQLSTATE[HY000] [2006] MySQL server has gone away in /var/www/html/web/public/nextcloud/lib/private/DB/Connection.php:64\nStack trace:\n#0 /var/www/html/web/public/nextcloud/3rdparty
/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\DB\Connection->connect()\n#1 /var/www/html/web/public/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\DB
AL\Connection->getDatabasePlatformVersion()\n#2 /var/www/html/web/public/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\DBAL\Connection->detectDatabasePlatform(
)\n#3 /var/www/html/web/public/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\DBAL\Connection->getDatabasePlatform()\n#4 /var/www/html/web/public/nextcloud/lib/p
rivate/DB/Connection.php(151): Doctrine\DBAL\Connection->setTransactionIsolation(2)\n#5 /var/www/html/web/public/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DB in /var/www/html/web/public/nextc
loud/lib/private/DB/Connection.php on line 64

The access to the database using the user and pass has been tested and it works.

Any ideas?

Thanks for your help
Richi

1 Like

UPDATE:
I’ve setup a new database in another server.
I’ve done a mysqldump from one server to the other.
In the second server it has mysql 5.7.22 and it works.

So looks like:

  • Nextcloud 13 doesn’t like Mysql 8
  • Something is wrong in the first mysql server

What do you think?

Thanks !!

Had a similiar problem today, this is likely a side effect from the new password schema in MySQL 8.0

https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password

Setting

[mysqld]
default_authentication_plugin=mysql_native_password

in my.cnf seems to help.

There is also a PHP bug here for 7.2.8 (that’s why I’ve hit the problem):
https://bugs.php.net/bug.php?id=76651

4 Likes

Spot on glycoknob !!!

[mysqld]
 default_authentication_plugin=mysql_native_password

That fixed my setup.

Thank you very much indeed !!!

1 Like