nextcloud_ynh
nextcloud_ynh copied to clipboard
Getting email every 15 minutes :PHP Fatal error: Uncaught Doctrine\DBAL\DBALException
Hi
I started getting an error email after every 15 minutes. This happened after I upgraded to latest nextcloud from command line.
Error:
subject: Cron <nextcloud@domain> /usr/bin/php -f /var/www/nextcloud/cron.php
Message:
PHP Fatal error: Uncaught Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occured in driver: could not find driver in /var/www/nextcloud/lib/private/DB/Connection.php:61
Stack trace:
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\DB\Connection->connect()
#1 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#2 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\DBAL\Connection->detectDatabasePlatform()
#3 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\DBAL\Connection->getDatabasePlatform()
#4 /var/www/nextcloud/lib/private/DB/Connection.php(148): Doctrine\DBAL\Connection->setTransactionIsolation(2)
#5 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\DB\Connection->__construct(Array, Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Configura in /var/www/nextcloud/lib/private/DB/Connection.php on line 61
PHP Fatal error: Uncaught Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occured in driver: could not find driver in /var/www/nextcloud/lib/private/DB/Connection.php:61
Stack trace:
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\DB\Connection->connect()
#1 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#2 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\DBAL\Connection->detectDatabasePlatform()
#3 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\DBAL\Connection->getDatabasePlatform()
#4 /var/www/nextcloud/lib/private/DB/Connection.php(148): Doctrine\DBAL\Connection->setTransactionIsolation(2)
#5 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\DB\Connection->__construct(Array, Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Configura in /var/www/nextcloud/lib/private/DB/Connection.php on line 61
Can someone explain me why is the error occurring? I have tried to install all the mysql packages. But the email every 15 minutes is making me mad.
I've seen this upstream bug that looks like yours, maybe cast an eye on it...?
I have solved it by changing */15 * * * * #USER# /usr/bin/php -f #DESTDIR#/cron.php
to */15 * * * * nextcloud /usr/bin/php5 -f #DESTDIR#/cron.php
in the line https://github.com/YunoHost-Apps/nextcloud_ynh/blob/master/conf/nextcloud.cron#L1.
I have php7 installed too.
Can someone test if changing /usr/bin/php to /usr/bin/php5 works? We can replace it so that there is no similar error. Otherwise feel free to close the issue, someone who faces it can change it himself.
Closing because super old issue, not enough info to reproduce, probably a missing lib ...