Cron Synology Driver exception

Hi !
I have a Nextcloud 10 on my DSM 6 (synology nas). And when i try to set cron i get an error with this command via ssh

php -f /volume1/web/nextcloud/cron.php

Error:

PHP Fatal error:  Uncaught exception 'Doctrine\DBAL\DBALException' with message                                                                                                                                                              'Failed to connect to the database: An exception occured in driver: could not fi                                                                                                                                                             nd driver' in /volume1/web/nextcloud/lib/private/DB/Connection.php:59
Stack trace:
#0 /volume1/web/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.ph                                                                                                                                                             p(429): OC\DB\Connection->connect()
#1 /volume1/web/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.ph                                                                                                                                                             p(389): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#2 /volume1/web/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.ph                                                                                                                                                             p(328): Doctrine\DBAL\Connection->detectDatabasePlatform()
#3 /volume1/web/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.ph                                                                                                                                                             p(621): Doctrine\DBAL\Connection->getDatabasePlatform()
#4 /volume1/web/nextcloud/lib/private/DB/Connection.php(142): Doctrine\DBAL\Conn                                                                                                                                                             ection->setTransactionIsolation(2)
#5 /volume1/web/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager                                                                                                                                                             .php(172): OC\DB\Connection->__construct(Array, Object(Doctrine\DBAL\D in /volum                                                                                                                                                             e1/web/nextcloud/lib/private/DB/Connection.php on line 59
PHP Fatal error:  Uncaught exception 'Doctrine\DBAL\DBALException' with message                                                                                                                                                              'Failed to connect to the database: An exception occured in driver: could not fi                                                                                                                                                             nd driver' in /volume1/web/nextcloud/lib/private/DB/Connection.php:59
Stack trace:
#0 /volume1/web/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.ph                                                                                                                                                             p(429): OC\DB\Connection->connect()
#1 /volume1/web/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.ph                                                                                                                                                             p(389): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#2 /volume1/web/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.ph                                                                                                                                                             p(328): Doctrine\DBAL\Connection->detectDatabasePlatform()
#3 /volume1/web/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.ph                                                                                                                                                             p(621): Doctrine\DBAL\Connection->getDatabasePlatform()
#4 /volume1/web/nextcloud/lib/private/DB/Connection.php(142): Doctrine\DBAL\Conn                                                                                                                                                             ection->setTransactionIsolation(2)
#5 /volume1/web/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager                                                                                                                                                             .php(172): OC\DB\Connection->__construct(Array, Object(Doctrine\DBAL\D in /volum                                                                                                                                                             e1/web/nextcloud/lib/private/DB/Connection.php on line 59

Any idea or help ?
Sorry if i was a noob :confused:

Do you see anything in your Nextcloud logs? It should be called owncloud.log, ( or possibly Nextcloud.log now?)

Nothing in nextcloud logs

Are you using the webserver user (eg http )?

Most of the time when running a php command, you use sudo -u http php command

… with http being replaced by your webserver’s user and command replaced by the command you want to run.

Same error with

sudo -u http php -f /volume1/web/nextcloud/cron.php

And http is the correct user for your webserver, right?

This is Right my webserver user is http

Did anyone found a solution? I have the same problem here…

Ok… i found a solution, the command has to be:

sudo -u http php56 -f /volume1/web/nextcloud/cron.php

because the php without “56” is an old version without the necessary modules.

Hope this helps.

aHi

IT WORKS ! :smiley:
Thanks dude :slight_smile:

Another problem: After Reboot the cron job is deleted.

Solution: Don´t use spaces between the columns in the cron entry -> only tabs

*/15 * * * * http sudo -u http php56 -f /volume1/web/nextcloud/cron.php

aHi