I have been running Nextcloud 16.0.0 on CentOS 7 with Nginx and PHP 7.2 (remi) for awhile, however, when I tried to upgrade to PHP 7.3 Nextcloud simply stopped working. The only error indicated by Nginx error log is the following. Any ideas why it suddenly stopped communicating with MySQL?
2019/07/06 12:45:35 [error] 1565#0: *1 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] No such file or directory in /var/www/nextcloud/lib/private/DB/Connection.php:64
Stack trace:
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(448): OC\DB\Connection->connect()
#1 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(410): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#2 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(354): Doctrine\DBAL\Connection->detectDatabasePlatform()
#3 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(710): Doctrine\DBAL\Connection->getDatabasePlatform()
#4 /var/www/nextcloud/lib/private/DB/Connection.php(151): Doctrine\DBAL\Connection->setTransactionIsolation(2)
#5 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(181): OC\DB\Connection->__construct(Array, Objec...PHP message: PHP Fatal error: Uncaught Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] No such file or directory in /var/www/nextcloud/lib/private/DB/Connection.php:64
Stack trace:
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(448): OC\DB\Connection->connect()
#1 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(410): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#2 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(354): Doctrine\DBAL\Connection->detectDatabasePlatform()
#3 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(710): Doctrine\DBAL\Connection->getDatabasePlatform()
#4 /var/www/nextcloud/lib/private/DB/Connection.php(151): Doctrine\DBAL\Connection->setTransactionIsolation(2)
#5 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(181)
All the require packages are installed.
php.x86_64 7.3.7-3.el7.remi @remi-php73
php-bcmath.x86_64 7.3.7-3.el7.remi @remi-php73
php-cli.x86_64 7.3.7-3.el7.remi @remi-php73
php-common.x86_64 7.3.7-3.el7.remi @remi-php73
php-devel.x86_64 7.3.7-3.el7.remi @remi-php73
php-fedora-autoloader.noarch 1.0.0-1.el7 @epel
php-fpm.x86_64 7.3.7-3.el7.remi @remi-php73
php-gd.x86_64 7.3.7-3.el7.remi @remi-php73
php-intl.x86_64 7.3.7-3.el7.remi @remi-php73
php-json.x86_64 7.3.7-3.el7.remi @remi-php73
php-ldap.x86_64 7.3.7-3.el7.remi @remi-php73
php-mbstring.x86_64 7.3.7-3.el7.remi @remi-php73
php-mysqlnd.x86_64 7.3.7-3.el7.remi @remi-php73
php-opcache.x86_64 7.3.7-3.el7.remi @remi-php73
php-pdo.x86_64 7.3.7-3.el7.remi @remi-php73
php-pear.noarch 1:1.10.9-3.el7.remi @remi-php72
php-pecl-apcu.x86_64 5.1.17-2.el7.remi.7.3 @remi-php73
php-pecl-apcu-devel.x86_64 5.1.17-2.el7.remi.7.3 @remi-php73
php-pecl-mcrypt.x86_64 1.0.2-2.el7.remi.7.3 @remi-php73
php-pecl-zip.x86_64 1.15.4-1.el7.remi.7.3 @remi-php73
php-process.x86_64 7.3.7-3.el7.remi @remi-php73
php-smbclient.x86_64 1.0.0-2.el7.remi.7.3 @remi-php73
php-xml.x86_64 7.3.7-3.el7.remi @remi-php73
mariadb.x86_64 1:5.5.60-1.el7_5 @updates
mariadb-libs.x86_64 1:5.5.60-1.el7_5 @updates
mariadb-server.x86_64 1:5.5.60-1.el7_5 @updates
MariaDB is also running
● mariadb.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2019-07-06 12:45:36 PDT; 8min ago
Process: 1514 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=0/SUCCESS)
Process: 1439 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)
Main PID: 1512 (mysqld_safe)
CGroup: /system.slice/mariadb.service
├─1512 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
└─2293 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mariadb/mariadb.log --pid-file=/var/run/mariadb/mariadb.pid --socket=/var/lib/mysql/mysql.sock --port=3306
Jul 06 12:45:33 nextcloud.dotslash.io systemd[1]: Starting MariaDB database server...
Jul 06 12:45:33 nextcloud.dotslash.io mariadb-prepare-db-dir[1439]: Database MariaDB is probably initialized in /var/lib/mysql already, nothing is done.
Jul 06 12:45:34 nextcloud.dotslash.io mariadb-prepare-db-dir[1439]: If this is not the case, make sure the /var/lib/mysql is empty before running mariadb-prepare-db-dir.
Jul 06 12:45:34 nextcloud.dotslash.io mysqld_safe[1512]: 190706 12:45:34 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
Jul 06 12:45:34 nextcloud.dotslash.io mysqld_safe[1512]: 190706 12:45:34 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Jul 06 12:45:36 nextcloud.dotslash.io systemd[1]: Started MariaDB database server.
config.php
<?php
$CONFIG = array (
'instanceid' => '<redacted>',
'passwordsalt' => '<redacted>',
'secret' => '<redacted>',
'trusted_domains' =>
array (
0 => 'nextcloud.example.com',
),
'datadirectory' => '/var/www/nextcloud/data',
'dbtype' => 'mysql',
'version' => '16.0.0.9',
'overwrite.cli.url' => 'https://nextcloud.example.com',
'dbname' => 'nextcloud',
'dbhost' => 'localhost',
'dbport' => '3306',
'dbtableprefix' => 'oc_',
'dbuser' => 'nextcloud',
'dbpassword' => '<redacted>',
'installed' => true,
'mail_from_address' => 'nextcloud',
'mail_smtpmode' => 'smtp',
'mail_smtphost' => 'mail.example.com',
'mail_smtpport' => '25',
'mail_domain' => 'example.com',
'ldapIgnoreNamingRules' => false,
'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
'skeletondirectory' => '',
'memcache.local' => '\\OC\\Memcache\\APCu',
'updater.release.channel' => 'stable',
'maintenance' => false,
'loglevel' => 2,
'twofactor_enforced' => 'false',
'twofactor_enforced_groups' =>
array (
),
'twofactor_enforced_excluded_groups' =>
array (
),
'theme' => '',
'mail_sendmailmode' => 'smtp',
'mail_smtpsecure' => 'tls',
'mysql.utf8mb4' => true,
);