Mariadb msql 10.0 upgrade to 10.5 going wrong

Nextcloud version:20.8
Operating system and version: ubuntu tls 16.04
Apache newest version avaible on 16.04
PHP version 7.3

The issue you are facing:
Database issue after upgrade:
interal server error. Did some digging found the following:
SQLSTATE[HY000] [2002] No such line/dbal/lib/Doctrine/DBAL/Connection.php",“line”:1449
am running my database localhost config looks fine aswell.

Weird thing was could not connect to the database after upgrading;
mysql -S /var/run/mysqld/mysql.sock -D nextcloud -u nextclouduser -p
MariaDB [nextcloud]> show tables;

Is this the first time you’ve seen this error? _(Y

Steps to replicate it:

  1. upgrade mariadb 10.0 to 10.5
  2. i used this Upgrade to MariaDB Community Server 10.5 on Ubuntu 16.04 LTS — MariaDB Enterprise documentation

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' => 'id',
  'passwordsalt' => 'pasword',
  'secret' => 'key',
  'trusted_domains' => 
  array (
    0 => '10.16.11.3',
    1 => 'fqdn',
    2 => 'some external ip,
  ),
  'datadirectory' => '/var/www/nextcloud-data',
  'dbtype' => 'mysql',
  'version' => '20.0.8.1',
  'overwrite.cli.url' => 'http://10.16.11.3',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextclouduser',
  'dbpassword' => 'paswword,
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'filelocking.enabled' => 'true',
  'redis' => 
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
  ),
  'mysql.utf8mb4' => true,
  'maintenance' => false,
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'theme' => '',
  'loglevel' => 2,
);

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

SQLSTATE[HY000] [2002] No such file or directory","Code":0,"Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php","line":1449

If you can’t connect through the socket on command line, it’s not really surprising that it will fail with Nextcloud as well. The socket is still configured at the same location, and you can see it in the filesystem? Errors in your database log?

I assume so. I did not change location myself. I just removed mariadb 10.0 and upgraded to 10.5.
In the end i was running out of time so i restore the backup.

Only log i secured is this one:
root@cloud:/var/www/nextcloud/data# cat nextcloud.log
{“reqId”:“G2G9qBNmBv1fsnbq48y3”,“level”:3,“time”:“2021-03-31T15:02:00+00:00”,“re moteAddr”:“ipadress”,“user”:"–",“app”:“index”,“method”:“GET”,“url”:"/",“mes sage”:{“Exception”:“Doctrine\DBAL\DBALException”,“Message”:“Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] No such file or directory”,“Code”:0,“Trace”:[{“file”:"/var/www/nextcloud/3rdparty/doctr ine/dbal/lib/Doctrine/DBAL/Connection.php",“line”:1449,“function”:“connect”,“cla ss”:“OC\DB\Connection”,“type”:"->",“args”:[]},{“file”:"/var/www/nextcloud/3rdp arty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php",“line”:892,“function”:“getW rappedConnection”,“class”:“Doctrine\DBAL\Connection”,“type”:"->",“args”:[]},{" file":"/var/www/nextcloud/lib/private/DB/Connection.php",“line”:202,“function”:" executeQuery",“class”:“Doctrine\DBAL\Connection”,“type”:"->",“args”:[“SELECT * FROM oc_appconfig“,[],[],null]},{“file”:”/var/www/nextcloud/3rdparty/doctrine /dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php”,“line”:206,“function”:“executeQu ery”,“class”:“OC\DB\Connection”,“type”:"->",“args”:[“SELECT * FROM oc_appconf ig“,[],[]]},{“file”:”/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilde r.php”,“line”:217,“function”:“execute”,“class”:“Doctrine\DBAL\Query\QueryBuil der”,“type”:"->",“args”:[]},{“file”:"/var/www/nextcloud/lib/private/AppConfig.ph p",“line”:345,“function”:“execute”,“class”:“OC\DB\QueryBuilder\QueryBuilder”, “type”:"->",“args”:[]},{“file”:"/var/www/nextcloud/lib/private/AppConfig.php",“l ine”:110,“function”:“loadConfigValues”,“class”:“OC\AppConfig”,“type”:"->",“args “:[]},{“file”:”/var/www/nextcloud/lib/private/AppConfig.php”,“line”:301,“functio n”:“getApps”,“class”:“OC\AppConfig”,“type”:"->",“args”:[]},{“file”:"/var/www/ne xtcloud/lib/private/legacy/OC_App.php",“line”:949,“function”:“getValues”,“class” :“OC\AppConfig”,“type”:"->",“args”:[false,“installed_version”]},{“file”:"/var/w ww/nextcloud/lib/private/Server.php",“line”:668,“function”:“getAppVersions”,“cla ss”:“OC_App”,“type”:"::",“args”:[]},{“file”:"/var/www/nextcloud/lib/private/AppF ramework/Utility/SimpleContainer.php",“line”:155,“function”:“OC\{closure}”,“cla ss”:“OC\Server”,“type”:"->",“args”:["*** sensitive parameters replaced "]},{ “file”:"/var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php",“lin e”:118,“function”:“OC\AppFramework\Utility\{closure}”,“class”:“OC\AppFramewo rk\Utility\SimpleContainer”,“type”:"->",“args”:[" sensitive parameters repl aced "]},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleC ontainer.php",“line”:122,“function”:“offsetGet”,“class”:“Pimple\Container”,“typ e”:"->",“args”:[“OC\Memcache\Factory”]},{“file”:"/var/www/nextcloud/lib/privat e/ServerContainer.php",“line”:156,“function”:“query”,“class”:“OC\AppFramework\ Utility\SimpleContainer”,“type”:"->",“args”:[“OC\Memcache\Factory”,true]},{“f ile”:"/var/www/nextcloud/lib/private/Server.php",“line”:1677,“function”:“query”, “class”:“OC\ServerContainer”,“type”:"->",“args”:[“OC\Memcache\Factory”]},{“fi le”:"/var/www/nextcloud/lib/private/Server.php",“line”:1017,“function”:“getMemCa cheFactory”,“class”:“OC\Server”,“type”:"->",“args”:[]},{“file”:"/var/www/nextcl oud/lib/private/AppFramework/Utility/SimpleContainer.php",“line”:155,“function”: “OC\{closure}”,“class”:“OC\Server”,“type”:"->",“args”:[" sensitive paramete rs replaced "]},{“file”:"/var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple /Container.php",“line”:118,“function”:“OC\AppFramework\Utility\{closure}”,“cl ass”:“OC\AppFramework\Utility\SimpleContainer”,“type”:"->",“args”:[" sensi tive parameters replaced "]},{“file”:"/var/www/nextcloud/lib/private/AppFrame work/Utility/SimpleContainer.php",“line”:122,“function”:“offsetGet”,“class”:“Pim ple\Container”,“type”:"->",“args”:[“OCP\Lock\ILockingProvider”]},{“file”:"/va r/www/nextcloud/lib/private/ServerContainer.php",“line”:156,“function”:“query”," class":“OC\AppFramework\Utility\SimpleContainer”,“type”:"->",“args”:[“OCP\Lo ck\ILockingProvider”,true]},{“file”:"/var/www/nextcloud/lib/private/Server.php" ,“line”:1977,“function”:“query”,“class”:“OC\ServerContainer”,“type”:"->",“args” :[“OCP\Lock\ILockingProvider”]},{“file”:"/var/www/nextcloud/lib/private/Files/ View.php",“line”:118,“function”:“getLockingProvider”,“class”:“OC\Server”,“type” :"->",“args”:[]},{“file”:"/var/www/nextcloud/lib/private/Server.php",“line”:395, “function”:"__construct",“class”:“OC\Files\View”,“type”:"->",“args”:[]},{“file “:”/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php”,“lin e”:155,“function”:“OC\{closure}”,“class”:“OC\Server”,“type”:"->",“args”:[" sensitive parameters replaced "]},{“file”:"/var/www/nextcloud/3rdparty/pimple /pimple/src/Pimple/Container.php",“line”:118,“function”:“OC\AppFramework\Utili ty\{closure}”,“class”:“OC\AppFramework\Utility\SimpleContainer”,“type”:"->", “args”:[" sensitive parameters replaced "]},{“file”:"/var/www/nextcloud/li b/private/AppFramework/Utility/SimpleContainer.php",“line”:122,“function”:“offse tGet”,“class”:“Pimple\Container”,“type”:"->",“args”:[“OC\Files\Node\HookConn ector”]},{“file”:"/var/www/nextcloud/lib/private/ServerContainer.php",“line”:156 ,“function”:“query”,“class”:“OC\AppFramework\Utility\SimpleContainer”,“type”: “->”,“args”:[“OC\Files\Node\HookConnector”,true]},{“file”:"/var/www/nextcloud /lib/private/Server.php",“line”:1324,“function”:“query”,“class”:“OC\ServerConta iner”,“type”:"->",“args”:[“OC\Files\Node\HookConnector”]},{“file”:"/var/www/n extcloud/lib/base.php",“line”:595,“function”:“boot”,“class”:“OC\Server”,“type”: “->”,“args”:[]},{“file”:"/var/www/nextcloud/lib/base.php",“line”:1091,“function” :“init”,“class”:“OC”,“type”:"::",“args”:[]},{“file”:"/var/www/nextcloud/index.ph p",“line”:35,“args”:["/var/www/nextcloud/lib/base.php"],“function”:“require_once “}],“File”:”/var/www/nextcloud/lib/private/DB/Connection.php”,“Line”:72,“CustomM essage”:"–"},“userAgent”:“FreshpingBot/1.0 (+https://freshping.io/)”,“version”: “20.0.8.1”}
{“reqId”:“G2G9qBNmBv1fsnbq48y3”,“level”:3,“time”:“2021-03-31T15:02:00+00:00”,“re moteAddr”:“52.42.49.200”,“user”:"–",“app”:“core”,“method”:“GET”,“url”:"/",“mess age”:{“Exception”:“Doctrine\DBAL\DBALException”,“Message”:“Failed to connect t o the database: An exception occurred in driver: SQLSTATE[HY000] [2002] No such file or directory”,“Code”:0,“Trace”:[{“file”:"/var/www/nextcloud/3rdparty/doctri ne/dbal/lib/Doctrine/DBAL/Connection.php",“line”:1449,“function”:“connect”,“clas s”:“OC\DB\Connection”,“type”:"->",“args”:[]},{“file”:"/var/www/nextcloud/3rdpa rty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php",“line”:892,“function”:“getWr appedConnection”,“class”:“Doctrine\DBAL\Connection”,“type”:"->",“args”:[]},{“f ile”:"/var/www/nextcloud/lib/private/DB/Connection.php",“line”:202,“function”:“e xecuteQuery”,“class”:“Doctrine\DBAL\Connection”,“type”:"->",“args”:[“SELECT * FROM oc_appconfig“,[],[],null]},{“file”:”/var/www/nextcloud/3rdparty/doctrine/ dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php”,“line”:206,“function”:“executeQue ry”,“class”:“OC\DB\Connection”,“type”:"->",“args”:[“SELECT * FROM oc_appconfi g“,[],[]]},{“file”:”/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder .php”,“line”:217,“function”:“execute”,“class”:“Doctrine\DBAL\Query\QueryBuild er”,“type”:"->",“args”:[]},{“file”:"/var/www/nextcloud/lib/private/AppConfig.php “,“line”:345,“function”:“execute”,“class”:“OC\DB\QueryBuilder\QueryBuilder”,” type":"->",“args”:[]},{“file”:"/var/www/nextcloud/lib/private/AppConfig.php",“li ne”:110,“function”:“loadConfigValues”,“class”:“OC\AppConfig”,“type”:"->",“args” :[]},{“file”:"/var/www/nextcloud/lib/private/AppConfig.php",“line”:301,“function “:“getApps”,“class”:“OC\AppConfig”,“type”:”->”,“args”:[]},{“file”:"/var/www/nex tcloud/lib/private/legacy/OC_App.php",“line”:949,“function”:“getValues”,“class”: “OC\AppConfig”,“type”:"->",“args”:[false,“installed_version”]},{“file”:"/var/ww w/nextcloud/lib/private/Server.php",“line”:668,“function”:“getAppVersions”,“clas s”:“OC_App”,“type”:"::",“args”:[]},{“file”:"/var/www/nextcloud/lib/private/AppFr amework/Utility/SimpleContainer.php",“line”:155,“function”:“OC\{closure}”,“clas s”:“OC\Server”,“type”:"->",“args”:["
sensitive parameters replaced "]},{" file":"/var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php",“line “:118,“function”:“OC\AppFramework\Utility\{closure}”,“class”:“OC\AppFramewor k\Utility\SimpleContainer”,“type”:”->”,“args”:[" sensitive parameters repla ced "]},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleCo ntainer.php",“line”:122,“function”:“offsetGet”,“class”:“Pimple\Container”,“type “:”->”,“args”:[“OC\Memcache\Factory”]},{“file”:"/var/www/nextcloud/lib/private /ServerContainer.php",“line”:156,“function”:“query”,“class”:“OC\AppFramework\U tility\SimpleContainer”,“type”:"->",“args”:[“OC\Memcache\Factory”,true]},{“fi le”:"/var/www/nextcloud/lib/private/Server.php",“line”:1677,“function”:“query”," class":“OC\ServerContainer”,“type”:"->",“args”:[“OC\Memcache\Factory”]},{“fil e”:"/var/www/nextcloud/lib/private/Server.php",“line”:1017,“function”:“getMemCac heFactory”,“class”:“OC\Server”,“type”:"->",“args”:[]},{“file”:"/var/www/nextclo ud/lib/private/AppFramework/Utility/SimpleContainer.php",“line”:155,“function”:" OC\{closure}",“class”:“OC\Server”,“type”:"->",“args”:[" sensitive parameter s replaced "]},{“file”:"/var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/ Container.php",“line”:118,“function”:“OC\AppFramework\Utility\{closure}”,“cla ss”:“OC\AppFramework\Utility\SimpleContainer”,“type”:"->",“args”:[" sensit ive parameters replaced "]},{“file”:"/var/www/nextcloud/lib/private/AppFramew ork/Utility/SimpleContainer.php",“line”:122,“function”:“offsetGet”,“class”:“Pimp le\Container”,“type”:"->",“args”:[“OCP\Lock\ILockingProvider”]},{“file”:"/var /www/nextcloud/lib/private/ServerContainer.php",“line”:156,“function”:“query”,“c lass”:“OC\AppFramework\Utility\SimpleContainer”,“type”:"->",“args”:[“OCP\Loc k\ILockingProvider”,true]},{“file”:"/var/www/nextcloud/lib/private/Server.php", “line”:1977,“function”:“query”,“class”:“OC\ServerContainer”,“type”:"->",“args”: [“OCP\Lock\ILockingProvider”]},{“file”:"/var/www/nextcloud/lib/private/Files/V iew.php",“line”:118,“function”:“getLockingProvider”,“class”:“OC\Server”,“type”: “->”,“args”:[]},{“file”:"/var/www/nextcloud/lib/private/Server.php",“line”:395," function":"__construct",“class”:“OC\Files\View”,“type”:"->",“args”:[]},{“file” :"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",“line “:155,“function”:“OC\{closure}”,“class”:“OC\Server”,“type”:”->”,“args”:[" s

I just read through the guide you followed to upgrade your MariaDB installation and came across this:


$ sudo apt remove "mariadb-*"

Be sure to check that this wildcard does not unintentionally refer to any of your custom applications.


If it comes to removing several packages with a wildcard, I would always do a dry-run first, so see which packages are being touched to remove. It did happen to me before, that I trusted the guide and did not do a dry-run and it removed things, which were required by other applications.

Luckily you had a backup and could go back to that and can try the upgrade process again. On your next upgrade attempt, please could you use the following command first, and see what it is going to remove?

$ sudo apt remove -dry-run "mariadb-*"

I presume the uninstall/install messed up the required drivers for the database, hence you or Nextcloud could not connect to the new installation.

The only database on the server is a nextcloud database. Seems weird.