I recently upgraded Ubuntu from 16.04 to 18.04LTS and then upgraded Nextcloud to 16.0.3.
All the basics are working fine but I’m getting these PHP errors that I think are to do with the PHP version in the CRON job? Does this sound right and, if so, where can I find the hard coded PHP version so I can change it?
Many thanks,
Cliff
PHP Fatal error: Uncaught Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occurred in driver: could not find driver in /var/www/owncloud/lib/private/DB/Connection.php:64
Stack trace: #0 /var/www/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(448): OC\DB\Connection->connect() #1 /var/www/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(410): Doctrine\DBAL\Connection->getDatabasePlatformVersion() #2 /var/www/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(354): Doctrine\DBAL\Connection->detectDatabasePlatform() #3 /var/www/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(710): Doctrine\DBAL\Connection->getDatabasePlatform() #4 /var/www/owncloud/lib/private/DB/Connection.php(151): Doctrine\DBAL\Connection->setTransactionIsolation(2) #5 /var/www/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(181): OC\DB\Connection->__construct(Array, Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Configuration), in /var/www/owncloud/lib/private/DB/Connection.php on line 64
PHP Fatal error: Uncaught Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occurred in driver: could not find driver in /var/www/owncloud/lib/private/DB/Connection.php:64
Stack trace: #0 /var/www/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(448): OC\DB\Connection->connect() #1 /var/www/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(410): Doctrine\DBAL\Connection->getDatabasePlatformVersion() #2 /var/www/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(354): Doctrine\DBAL\Connection->detectDatabasePlatform() #3 /var/www/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(710): Doctrine\DBAL\Connection->getDatabasePlatform() #4 /var/www/owncloud/lib/private/DB/Connection.php(151): Doctrine\DBAL\Connection->setTransactionIsolation(2) #5 /var/www/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(181): OC\DB\Connection->__construct(Array, Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Configuration), in /var/www/owncloud/lib/private/DB/Connection.php on line 64
you need to re-install ALL the php-stuff manually, i think.
i just did a stretch->buster-upgrade and had the same error(s) and ended up re-installing (almost) every php-module manually (php was upgraded from 7.0 to 7.3)
your error (i had the same) tells you the db-module is missing. after re-installing that i was able to run occ which gave some (more) meaningful error-msgs.
in my .bash_history-file i find these: apt-get -sf install php7.3-common (not enough)
and that i did manual upgrades for the following other things: php7.3-opcache php7.3-xml php7.3-gd php7.3-mbstring php7.3-curl php7.3-zip
after that, i was able to apt-get -sf remove php7.0
of course, then i had to check/adjust the apache-and php-configs and (probably) restart your apache a couple of times. if you plan it well i guess 30-60 minutes downtime.
debian and its derivatives do the upgrade-process well but they cannot catch EVERYTHING.
GOOD LUCK!
Thanks pete.dawgg - yes, I was missing a couple of modules. Now that I have found them all and rebooted everything the error messages have gone away and the CRON Jobs are running again.
Thanks again for your help
I got the exact same error. Difference: I’m running it all in docker image: linuxserver/nextcloud last Sunday it yet worked. Somewhen this week it went rogue… I had automatic updates enabled with watchtower. Once I noticed nextcloud is not working I reverted everything to last known working versions of mariadb and nextcloud (not sure if mariadb has anything to do with it).
Since nextcloud is a stand-alone-docker-image, php-versions should be up-to-date too… any ideas how to aproach that problem:
PHP Fatal error: Uncaught Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2006] MySQL server has gone away in /config/www/nextcloud/lib/private/DB/Connection.php:64
@akrea, I am having the same issue from within Unraid, using the same linuxserver/nextcloud docker image. Did you ever find a solution that worked for you?
I have also started receiving this in my logs. Has not affected productivity yet but I cant imagine its good. Im on Ubuntu 16.04 running NC 19 as a Snap package so editing things isn’t the same as a bare bones install. If theres a better place to ask this question feel free to let me know.
Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000]
Thanks, after a couple of hours pulling my hair out trying to decipher a very generic error after upgrading the FreeBSD jail my nextcloud was running on, this was the missing part of the puzzle!
For anyone else googling, the generic error was:
“Internal Server Error
The server was unable to complete your request.
If this happens again, please send the technical details below to the server administrator.
More details can be found in the server log.”
On my side, I confirm this is related to PHP installation.
I experienced this issue after upgrading,
On my debian, i reinstalled packages listed by the following command:
dpkg --get-selections | grep -i php | grep deinstall
In my case:
apt install php8.0-bcmath php8.0-curl php8.0-gd php8.0-gmp php8.0-mbstring php8.0-xml php8.0-zip php8.0-mysql