Dear community,
My server hosts Nextcloud version 21.0.4.1 and has been upgraded to Ubuntu 20.04.3 LTS. In the course of this update, PHP 7.4 got replaced by PHP 8.0. After this, Nextcloud access to the database (MariaDB 10.3.31) was broken. We run Apache2 so that I accessed the Apache2 error log to identify a reason for this effect:
AH01071: Got error ‘PHP message: PHP Fatal error: Uncaught Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2006] MySQL server has gone away in /var/www/html/nextcloud/lib/private/DB/Connection.php:85\nStack trace:\n#0
/var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1486): OC\DB\Connection->connect()\n#1 /var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1014): Doctrine\DBAL\Connection->getWrappedConnection()\n#2
/var/www/html/nextcloud/lib/private/DB/Connection.php(226): Doctrine\DBAL\Connection->executeQuery()\n#3
/var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(210): OC\DB\Connection->executeQuery()\n#4
/var/www/html/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(287): Doctrine\DBAL\Query\QueryBuilder->execute()\n#5
/var/www/html/nextcloud/lib/private/AppConfig.php(345): OC\DB\QueryBuilder\QueryBuilder->execute()\n#6
/var/www/html/nextcloud/lib/private/AppConfig.php(110): OC\AppConfig->loadCo…’
Nextcloud version (eg, 20.0.5): 21.0.1.4
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04.3 LTS
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.49
PHP version (eg, 7.4): 8.0
Is this the first time you’ve seen this error? (Y/N): Y
The output of your Nextcloud log in Admin > Logging:
The error is such severe that only the Apache error log, but not the Nextcloud log is further populated.
Worth to note, when I connect to the Nextcloud database via phpMyAdmin that is installed at the same server, I can access the Nextcloud database.
I have already purged the entire php stuff and re-installed php8.0* packages and re-activated the php8.0-fpm module at Apache2. No change. I can still access the Nextcloud database via phpMyAdmin, but not via the Nextcloud code.
Best regards,
Peter