Owncloud stopped working after enabling crontab


#1

Steps to reproduce

  1. Enable Crontab as desrcibed in documentation
  2. Install mcrypt for crontab to work
  3. try to reach Owncloud (either client or web)

Expected behaviour

Owncloud works

Actual behaviour

Error Message:

Exception occurred while logging exception: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2002] Connection refused
#0 /var/www/cloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\DB\Connection->connect()
#1 /var/www/cloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#2 /var/www/cloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\DBAL\Connection->detectDatabasePlatform()
#3 /var/www/cloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\DBAL\Connection->getDatabasePlatform()
#4 /var/www/cloud/lib/private/DB/Connection.php(147): Doctrine\DBAL\Connection->setTransactionIsolation(2)
#5 /var/www/cloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\DB\Connection->__construct(Array, Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Configuration), Object(Doctrine\Common\EventManager))
#6 /var/www/cloud/lib/private/DB/ConnectionFactory.php(145): Doctrine\DBAL\DriverManager::getConnection(Array, Object(Doctrine\DBAL\Configuration), Object(Doctrine\Common\EventManager))
#7 /var/www/cloud/lib/private/Server.php(487): OC\DB\ConnectionFactory->getConnection(‘mysql’, Array)
#8 /var/www/cloud/lib/composer/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC{closure}(Object(OC\Server))
#9 /var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php(111): Pimple\Container->offsetGet(‘DatabaseConnect…’)
#10 /var/www/cloud/lib/private/ServerContainer.php(87): OC\AppFramework\Utility\SimpleContainer->query(‘DatabaseConnect…’)
#11 /var/www/cloud/lib/private/Server.php(1147): OC\ServerContainer->query(‘DatabaseConnect…’)
#12 /var/www/cloud/lib/private/Server.php(239): OC\Server->getDatabaseConnection()
#13 /var/www/cloud/lib/composer/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC{closure}(Object(OC\Server))
#14 /var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php(111): Pimple\Container->offsetGet(‘AccountMapper’)
#15 /var/www/cloud/lib/private/ServerContainer.php(87): OC\AppFramework\Utility\SimpleContainer->query(‘AccountMapper’)
#16 /var/www/cloud/lib/private/Server.php(999): OC\ServerContainer->query(‘AccountMapper’)
#17 /var/www/cloud/lib/private/Server.php(244): OC\Server->getAccountMapper()
#18 /var/www/cloud/lib/composer/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC{closure}(Object(OC\Server))
#19 /var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php(111): Pimple\Container->offsetGet(‘UserManager’)
#20 /var/www/cloud/lib/private/ServerContainer.php(87): OC\AppFramework\Utility\SimpleContainer->query(‘UserManager’)
#21 /var/www/cloud/lib/private/Server.php(992): OC\ServerContainer->query(‘UserManager’)
#22 /var/www/cloud/lib/private/Server.php(288): OC\Server->getUserManager()
#23 /var/www/cloud/lib/composer/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC{closure}(Object(OC\Server))
#24 /var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php(111): Pimple\Container->offsetGet(‘UserSession’)
#25 /var/www/cloud/lib/private/ServerContainer.php(87): OC\AppFramework\Utility\SimpleContainer->query(‘UserSession’)
#26 /var/www/cloud/lib/private/Server.php(1016): OC\ServerContainer->query(‘UserSession’)
#27 /var/www/cloud/lib/private/Server.php(541): OC\Server->getUserSession()
#28 /var/www/cloud/lib/composer/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC{closure}(Object(OC\Server))
#29 /var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php(111): Pimple\Container->offsetGet(‘AppManager’)
#30 /var/www/cloud/lib/private/ServerContainer.php(87): OC\AppFramework\Utility\SimpleContainer->query(‘AppManager’)
#31 /var/www/cloud/lib/private/Server.php(1346): OC\ServerContainer->query(‘AppManager’)
#32 /var/www/cloud/lib/private/legacy/app.php(343): OC\Server->getAppManager()
#33 /var/www/cloud/lib/private/legacy/app.php(111): OC_App::getEnabledApps()
#34 /var/www/cloud/lib/base.php(579): OC_App::loadApps(Array)
#35 /var/www/cloud/lib/base.php(1014): OC::init()
#36 /var/www/cloud/index.php(54): require_once(’/var/www/cloud/…’)
#37 {main}

Server configuration

Operating system: ubuntu16.04.1

Web server: apache2

Database: Mysql

PHP version: 7.1

ownCloud version: 10.0.4.4

Updated from an older ownCloud or fresh install: Updated

**The content of config/config.php:**

  'datadirectory' => '/var/www/cloud/data',
  'overwrite.cli.url' => '/',

Are you using encryption: no


#2

Hey,

have you tried to search around for this message here?

I think there could be some connectivity problem with your database in general which is not related to ownCloud.