Nextcloud version (eg, 12.0.2) : 15.0.2
Operating system and version (eg, Ubuntu 17.04) : Docker
Apache or nginx version (eg, Apache 2.4.25) : Apache 2
PHP version (eg, 7.1) : 7.2.14
The issue you are facing:
After restarting my nextcloud host device and after it came back up nextcloud no longer had any connection to the database. The database is up as i can access it via phpMyAdmin yet nextcloud cannot connect to it. I even rebuilt the database entirely as a docker image, it was running on the host OS before, to no avail
Is this the first time youâve seen this error? (Y/N) : y
Steps to replicate it:
- have working nextcloud setup with external mysql database
- restart host computer
The output of your Nextcloud log in Admin > Logging:
[Thu Mar 07 17:04:32.939414 2019] [php7:error] [pid 34] [client 10.10.10.3:21620] PHP Fatal error: Uncaught Doctrine\\DBAL\\DBALException: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2002] Connection timed out in /var/www/html/lib/private/DB/Connection.php:64\nStack trace:\n#0 /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\\DB\\Connection->connect()\n#1 /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\\DBAL\\Connection->getDatabasePlatformVersion()\n#2 /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\\DBAL\\Connection->detectDatabasePlatform()\n#3 /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\\DBAL\\Connection->getDatabasePlatform()\n#4 /var/www/html/lib/private/DB/Connection.php(151): Doctrine\\DBAL\\Connection->setTransactionIsolation(2)\n#5 /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\\DB\\Connection->__construct(Array, Object(Doctrine\\DBAL\\Driver\\PDOMySql\\Driver), Object(Doctrine\\DBAL\\Configuration), Object in /var/www/html/lib/private/DB/Connection.php on line 64,
[Thu Mar 07 17:04:33.483929 2019] [php7:error] [pid 36] [client 10.10.10.3:21621] PHP Fatal error: Uncaught Doctrine\\DBAL\\DBALException: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2002] Connection timed out in /var/www/html/lib/private/DB/Connection.php:64\nStack trace:\n#0 /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\\DB\\Connection->connect()\n#1 /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\\DBAL\\Connection->getDatabasePlatformVersion()\n#2 /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\\DBAL\\Connection->detectDatabasePlatform()\n#3 /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\\DBAL\\Connection->getDatabasePlatform()\n#4 /var/www/html/lib/private/DB/Connection.php(151): Doctrine\\DBAL\\Connection->setTransactionIsolation(2)\n#5 /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\\DB\\Connection->__construct(Array, Object(Doctrine\\DBAL\\Driver\\PDOMySql\\Driver), Object(Doctrine\\DBAL\\Configuration), Object in /var/www/html/lib/private/DB/Connection.php on line 64,
10.10.10.3 - ***** [07/Mar/2019:17:02:33 +0000] "GET /ocs/v2.php/apps/notifications/api/v2/notifications?format=json HTTP/1.1" 500 211 "-" "Mozilla/5.0 (Windows) mirall/2.5.1final (build 20181204) (Nextcloud)",
[Thu Mar 07 17:04:34.887842 2019] [php7:error] [pid 87] [client 10.10.10.3:21570] PHP Fatal error: Uncaught Doctrine\\DBAL\\DBALException: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2002] Connection timed out in /var/www/html/lib/private/DB/Connection.php:64\nStack trace:\n#0 /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\\DB\\Connection->connect()\n#1 /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\\DBAL\\Connection->getDatabasePlatformVersion()\n#2 /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\\DBAL\\Connection->detectDatabasePlatform()\n#3 /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\\DBAL\\Connection->getDatabasePlatform()\n#4 /var/www/html/lib/private/DB/Connection.php(151): Doctrine\\DBAL\\Connection->setTransactionIsolation(2)\n#5 /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\\DB\\Connection->__construct(Array, Object(Doctrine\\DBAL\\Driver\\PDOMySql\\Driver), Object(Doctrine\\DBAL\\Configuration), Object in /var/www/html/lib/private/DB/Connection.php on line 64,
10.10.10.3 - ***** [07/Mar/2019:17:02:04 +0000] "GET /status.php HTTP/1.1" 500 0 "-" "Mozilla/5.0 (Windows) mirall/2.5.1final (build 20181204) (Nextcloud)"
The output of your config.php file in /path/to/nextcloud
(make sure you remove any identifiable information!):
<?php
$CONFIG = array (
'htaccess.RewriteBase' => '/',
'trusted_domains' =>
array (
0 => 'X.X.X.55:8080',
),
'trusted proxies' =>
array (
0 => 'X.X.X.3',
),
'mail_smtpdebug' => 'true',
'overwritewebroot' => '/',
'overwritehost' => '*****',
'overwriteprotocol' => 'https',
'overwritecondaddr' => '^X\\.X\\.X\\.3$',
'memcache.local' => '\\OC\\Memcache\\APCu',
'apps_paths' =>
array (
0 =>
array (
'path' => '/var/www/html/apps',
'url' => '/apps',
'writable' => false,
),
1 =>
array (
'path' => '/var/www/html/custom_apps',
'url' => '/custom_apps',
'writable' => true,
),
),
'datadirectory' => '/var/www/html/data',
'dbtype' => 'mysql',
'version' => '15.0.2.0',
'overwrite.cli.url' => 'http://X.X.X.55:8080',
'installed' => true,
'mysql.utf8mb4' => true,
'maintenance' => false,
'dbname' => 'nextcloud',
'dbhost' => 'X.X.X.55:3306',
'dbuser' => 'nextcloud',
'dbpassword' => '*****',
'ldapIgnoreNamingRules' => false,
'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
'mail_smtpmode' => 'smtp',
'mail_sendmailmode' => '*****',
'mail_from_address' => '*****',
'mail_domain' => '*****',
'mail_smtphost' => '*****',
'mail_smtpport' => '25',
);
The output of your Apache/nginx/system log in /var/log/____
:
No web logs