Upgraded to 18.04 from 16.04 great at first, next day NC is down

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):15.0.8
Operating system and version (eg, Ubuntu 17.04):Ubuntu 18.04
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.41
PHP version (eg, 7.1):PHP 7.3.10-1+ubuntu16.04.1+deb.sury.org+1 (cli)
mysql version_:mysql Ver 15.1 Distrib 10.2.27-MariaDB

The issue you are facing:
Yesterday I upgraded php in 16.04, than upgraded to Ubuntu 18.04.
Everything pretty much worked right off, despite multiple server restarts.

Went to bed, and woke up to the dreaded error 500 in the client…

My Ubuntu server is also running in virtualbox, not sure if this matters, but though I should share it.

As the system looked to be creating tons of entries in the log files, I though may be I should put nextcloud into maintenence mode, may be give me a chance to address the issue before writing 1000 more lines …

sudo -u www-data /usr/bin/php /var/www/html/nextcloud/occ
An unhandled exception has been thrown:
Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2002] No such file or directory in /var/www/html/nextcloud/lib/private/DB/Connection.php:64
Stack trace:

Which led me to believe its a db issue… so…
glenn@glenn-VirtualBox:~$ systemctl status mariadb
● mariadb.service
Loaded: masked (/dev/null; bad)
Active: inactive (dead)

Than I though to,
sudo apt-get update

sudo apt-get dist-upgrade

The following packages have been kept back:
mariadb-client

lastly am unsure of how to proceed from

apt list --upgradable -a
Listing… Done
mariadb-client/bionic-updates,bionic-updates,bionic-security,bionic-security 1:10.1.41-0ubuntu0.18.04.1 all [upgradable from: 10.2.27+maria~xenial]
mariadb-client/bionic,bionic 1:10.1.29-6 all
mariadb-client/now 10.2.27+maria~xenial all [installed,upgradable to: 1:10.1.41-0ubuntu0.18.04.1]

I dont know if Im even on the right track, but every turn seams to throw more challenges that I cant overcome on my own ;(

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

The output of your Nextcloud log in Admin > Logging: NEXTCLOUD DOWN, Cant copy

PASTE HERE

The output of Nextcloud log $ tail -40 /var/www/html/nextcloud/data/nextcloud.log

Next repeats over and over...

{"reqId":"uoyFB77WTn0elEJbE8L8","level":3,"time":"2019-10-13T19:20:50+00:00","remoteAddr":"192.168.1.1","user":"glenn","app":"PHP","method":"PROPFIND","url":"\/remote.php\/dav\/files\/glenn\/Owncloud","message":"You are using a fallback implementation of the intl extension. Installing the native one is highly recommended instead. at \/var\/www\/html\/nextcloud\/3rdparty\/patchwork\/utf8\/src\/Patchwork\/Utf8\/Bootup\/intl.php#18","userAgent":"Mozilla\/5.0 (Windows) mirall\/2.6.0stable-Win64 (build 20190927) (Nextcloud)","version":"15.0.8.1"}

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

<?php
$CONFIG = array (
  'instanceid' => '',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' => 
  array (
    0 => 'mydomain.ddns.net',
  ),
  'datadirectory' => '/var/www/html/nextcloud/data',
  'overwrite.cli.url' => 'https://mydomain.ddns.net',
  'dbtype' => 'mysql',
  'version' => '15.0.8.1',
  'dbname' => 'nextclouddb',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'ncloudusr',
  'dbpassword' => '',
  'installed' => true,
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 1,
  'mail_from_address' => 'myemail',
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_domain' => 'gmail.com',
  'mail_smtphost' => 'smtp@gmail.com',
  'mail_smtpport' => '465',
  'mail_smtpauth' => 1,
);

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

[Mon Oct 14 00:08:43.387236 2019] [mpm_prefork:notice] [pid 941] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1d configured -- resuming normal operations

[Mon Oct 14 00:08:43.387260 2019] [core:notice] [pid 941] AH00094: Command line: '/usr/sbin/apache2'

[Mon Oct 14 00:08:46.280270 2019] [php7:error] [pid 4117] [client 192.168.1.1:15195] PHP Fatal error:  Uncaught Doctrine\\DBAL\\DBALException: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2002] No such file or directory in /var/www/html/nextcloud/lib/private/DB/Connection.php:64\nStack trace:\n#0 /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\\DB\\Connection->connect()\n#1 /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\\DBAL\\Connection->getDatabasePlatformVersion()\n#2 /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\\DBAL\\Connection->detectDatabasePlatform()\n#3 /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\\DBAL\\Connection->getDatabasePlatform()\n#4 /var/www/html/nextcloud/lib/private/DB/Connection.php(151): Doctrine\\DBAL\\Connection->setTransactionIsolation(2)\n#5 /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\\DB\\Connection->__construct(Array, Object(Doctrin in /var/www/html/nextcloud/lib/private/DB/Connection.php on line 64

[Mon Oct 14 00:08:46.280526 2019] [php7:error] [pid 4117] [client 192.168.1.1:15195] PHP Fatal error:  Uncaught Doctrine\\DBAL\\DBALException: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2002] No such file or directory in /var/www/html/nextcloud/lib/private/DB/Connection.php:64\nStack trace:\n#0 /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\\DB\\Connection->connect()\n#1 /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\\DBAL\\Connection->getDatabasePlatformVersion()\n#2 /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\\DBAL\\Connection->detectDatabasePlatform()\n#3 /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\\DBAL\\Connection->getDatabasePlatform()\n#4 /var/www/html/nextcloud/lib/private/DB/Connection.php(151): Doctrine\\DBAL\\Connection->setTransactionIsolation(2)\n#5 /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\\DB\\Connection->__construct(Array, Object(Doctrin in /var/www/html/nextcloud/lib/private/DB/Connection.php on line 64

[Mon Oct 14 00:08:51.187994 2019] [php7:error] [pid 4116] [client 192.168.1.1:15196] PHP Fatal error:  Uncaught Doctrine\\DBAL\\DBALException: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2002] No such file or directory in /var/www/html/nextcloud/lib/private/DB/Connection.php:64\nStack trace:\n#0 /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\\DB\\Connection->connect()\n#1 /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\\DBAL\\Connection->getDatabasePlatformVersion()\n#2 /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\\DBAL\\Connection->detectDatabasePlatform()\n#3 /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\\DBAL\\Connection->getDatabasePlatform()\n#4 /var/www/html/nextcloud/lib/private/DB/Connection.php(151): Doctrine\\DBAL\\Connection->setTransactionIsolation(2)\n#5 /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\\DB\\Connection->__construct(Array, Object(Doctrin in /var/www/html/nextcloud/lib/private/DB/Connection.php on line 64

[Mon Oct 14 00:08:51.188220 2019] [php7:error] [pid 4116] [client 192.168.1.1:15196] PHP Fatal error:  Uncaught Doctrine\\DBAL\\DBALException: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2002] No such file or directory in /var/www/html/nextcloud/lib/private/DB/Connection.php:64\nStack trace:\n#0 /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\\DB\\Connection->connect()\n#1 /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\\DBAL\\Connection->getDatabasePlatformVersion()\n#2 /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\\DBAL\\Connection->detectDatabasePlatform()\n#3 /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\\DBAL\\Connection->getDatabasePlatform()\n#4 /var/www/html/nextcloud/lib/private/DB/Connection.php(151): Doctrine\\DBAL\\Connection->setTransactionIsolation(2)\n#5 /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\\DB\\Connection->__construct(Array, Object(Doctrin in /var/www/html/nextcloud/lib/private/DB/Connection.php on line 64

[Mon Oct 14 00:08:56.186711 2019] [php7:error] [pid 4115] [client 192.168.1.1:15198] PHP Fatal error:  Uncaught Doctrine\\DBAL\\DBALException: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2002] No such file or directory in /var/www/html/nextcloud/lib/private/DB/Connection.php:64\nStack trace:\n#0 /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\\DB\\Connection->connect()\n#1 /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\\DBAL\\Connection->getDatabasePlatformVersion()\n#2 /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\\DBAL\\Connection->detectDatabasePlatform()\n#3 /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\\DBAL\\Connection->getDatabasePlatform()\n#4 /var/www/html/nextcloud/lib/private/DB/Connection.php(151): Doctrine\\DBAL\\Connection->setTransactionIsolation(2)\n#5 /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\\DB\\Connection->__construct(Array, Object(Doctrin in /var/www/html/nextcloud/lib/private/DB/Connection.php on line 64

Not sure this will help or you’ve tried things listed here:

My guess is probably with your database missing –
systemctl message says its dead – -- what happens if you restart service?
systemctl mariadb restart

Yup… the upgrade totally hosed MariaDB… Sudo apt-get install to the rescue…
Surprisingly nextcloud was up right away…

you need to reinstall all (required) php-modules bc of the version-change.
if you’re worried about your db try to connect to it manually, sometimes (rarely)you have to run mysqlupgrade manually.
(with “starting” the db i cannot help you since i never use systemd.)
GOOD LUCK!