NextCloud suddently not available

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 12.0.2):
Operating system and version (eg, Ubuntu 17.04):
Apache or nginx version (eg, Apache 2.4.25):
PHP version (eg, 7.1):

The issue you are facing:
NextCloud was running fine on a virrtual machine. Suddenly I received nagios emails that Login redirect and HTTPS are CRITICAL. I’ve tried a lot of things and then saw in the logs that there was a database access exception. Nothing has changed in the setup, expect that mysql was automatically updated:

mysql-client-5.7:amd64 5.7.23-0ubuntu0.16.04.1 => 5.7.24-0ubuntu0.16.04.1
mysql-client-core-5.7:amd64 5.7.23-0ubuntu0.16.04.1 => 5.7.24-0ubuntu0.16.04.1
mysql-common:all 5.7.23-0ubuntu0.16.04.1 => 5.7.24-0ubuntu0.16.04.1

Is this the first time you’ve seen this error? (Y/N):

Steps to replicate it:

  1. just access nextcloud

The output of your Nextcloud log in Admin > Logging:

PASTE HERE

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => 'oc7cv3lwrs3j',
  'passwordsalt' => 'xxxxx',
  'secret' => 'xxxxx',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => 'neurorobotics-files  .net',
  ),
  'datadirectory' => '/nfs/hbp/owncloud_data',
  'overwrite.cli.url' => 'http://localhost',
  'dbtype' => 'mysql',
  'version' => '13.0.2.1',
  'dbname' => 'hbp_nextcloud',
  'dbhost' => 'vmknoll28',
  'dbport' => '3306',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'hbp_oc_admin',
  'dbpassword' => '************',
  'installed' => true,
  'maintenance' => false,
);

The output of your Apache/nginx/system log in /var/log/____:

[Fri Oct 26 06:25:21.404392 2018] [ssl:info] [pid 1654] AH01914: Configuring server neurorobotics-files .net:443 for SSL protocol
[Fri Oct 26 06:25:21.404750 2018] [ssl:info] [pid 1654] AH02568: Certificate and private key neurorobotics-files .net:443:0 configured from /etc/ssl/certs/neurorobotics-files.pem and /etc/ssl/private/neurorobotics-files .key.pem
[Fri Oct 26 06:25:21.404880 2018] [mpm_prefork:notice] [pid 1654] AH00163: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Fri Oct 26 06:25:21.404886 2018] [core:notice] [pid 1654] AH00094: Command line: '/usr/sbin/apache2'
[Fri Oct 26 06:35:11.081676 2018] [ssl:info] [pid 45915] [client 131.159.60.185:36403] AH01964: Connection to child 3 established (server neurorobotics-files. net:443)
[Fri Oct 26 06:35:11.175702 2018] [:error] [pid 45915] [client 131.159.60.185:36403] PHP Fatal error:  Uncaught Doctrine\\DBAL\\DBALException: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [1045] Access denied for user 'hbp_oc_admin'@'vmknoll36 .in.tum.de' (using password: YES) in /var/www/nextcloud/lib/private/DB/Connection.php:64\nStack trace:\n#0 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\\DB\\Connection->connect()\n#1 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\\DBAL\\Connection->getDatabasePlatformVersion()\n#2 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\\DBAL\\Connection->detectDatabasePlatform()\n#3 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\\DBAL\\Connection->getDatabasePlatform()\n#4 /var/www/nextcloud/lib/private/DB/Connection.php(151): Doctrine\\DBAL\\Connection->setTransactionIsolation(2)\n#5 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\\DB\\Connection->__construct( in /var/www/nextcloud/lib/private/DB/Connection.php on line 64
[Fri Oct 26 06:35:11.176742 2018] [:error] [pid 45915] [client 131.159.60.185:36403] PHP Fatal error:  Uncaught Doctrine\\DBAL\\DBALException: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [1045] Access denied for user 'hbp_oc_admin'@'vmknoll36 .in.tum.de' (using password: YES) in /var/www/nextcloud/lib/private/DB/Connection.php:64\nStack trace:\n#0 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\\DB\\Connection->connect()\n#1 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\\DBAL\\Connection->getDatabasePlatformVersion()\n#2 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\\DBAL\\Connection->detectDatabasePlatform()\n#3 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\\DBAL\\Connection->getDatabasePlatform()\n#4 /var/www/nextcloud/lib/private/DB/Connection.php(151): Doctrine\\DBAL\\Connection->setTransactionIsolation(2)\n#5 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\\DB\\Connection->__construct( in /var/www/nextcloud/lib/private/DB/Connection.php on line 64
[Fri Oct 26 06:35:12.110544 2018] [ssl:info] [pid 45916] [client 131.159.60.185:36409] AH01964: Connection to child 4 established (server neurorobotics-files.net:443)
[Fri Oct 26 06:35:12.131935 2018] [:error] [pid 45916] [client 131.159.60.185:36409] PHP Fatal error:  Uncaught Doctrine\\DBAL\\DBALException: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [1045] Access denied for user 'hbp_oc_admin'@'vmknoll36.in.tum.de' (using password: YES) in /var/www/nextcloud/lib/private/DB/Connection.php:64\nStack trace:\n#0 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\\DB\\Connection->connect()\n#1 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\\DBAL\\Connection->getDatabasePlatformVersion()\n#2 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\\DBAL\\Connection->detectDatabasePlatform()\n#3 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\\DBAL\\Connection->getDatabasePlatform()\n#4 /var/www/nextcloud/lib/private/DB/Connection.php(151): Doctrine\\DBAL\\Connection->setTransactionIsolation(2)\n#5 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\\DB\\Connection->__construct( in /var/www/nextcloud/lib/private/DB/Connection.php on line 64
[Fri Oct 26 06:35:12.133008 2018] [:error] [pid 45916] [client 131.159.60.185:36409] PHP Fatal error:  Uncaught Doctrine\\DBAL\\DBALException: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [1045] Access denied for user 'hbp_oc_admin'@'vmknoll36 .in.tum.de' (using password: YES) in /var/www/nextcloud/lib/private/DB/Connection.php:64\nStack trace:\n#0 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\\DB\\Connection->connect()\n#1 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\\DBAL\\Connection->getDatabasePlatformVersion()\n#2 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\\DBAL\\Connection->detectDatabasePlatform()\n#3 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\\DBAL\\Connection->getDatabasePlatform()\n#4 /var/www/nextcloud/lib/private/DB/Connection.php(151): Doctrine\\DBAL\\Connection->setTransactionIsolation(2)\n#5 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\\DB\\Connection->__construct( in /var/www/nextcloud/lib/private/DB/Connection.php on line 64
[Fri Oct 26 06:38:11.196186 2018] [ssl:info] [pid 45917] [client 131.159.60.185:36465] AH01964: Connection to child 10 established (server )

Yes and now your setup has problems to connect to the database. You can try to restart your database server manually and see if there are errors. If you manage to start the database, you can try to login to the Nextcloud database and check if the tables are there and not empty.