Owncloud can not find database during upgrade from 10.0.10 to 10.3.1


I’ve been looking all over the web for help and I am at wit’s end.

This may be complicated by the fact that I access owncloud at https://cloud.domain.fr and apparently was not correctly configured in 10.0 (though it ran).

  • Scott

Steps to reproduce

  1. sudo -u http php73 occ upgrade

Expected behaviour

i am going through the steps for manual upgrade from 10.0.10 to 10.3.1 I am stuck at the upgrade command.

Actual behaviour

Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2002] No such file or directory in /volume1/web/owncloud/lib/private/DB/Connection.php:62

#0 /volume1/web/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\DB\Connection->connect()

#1 /volume1/web/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\DBAL\Connection->getDatabasePlatformVersion()

#2 /volume1/web/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\DBAL\Connection->detectDatabasePlatform()

#3 /volume1/web/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\DBAL\Connection->getDatabasePlatform()

#4 /volume1/web/owncloud/lib/private/DB/Connection.php(144): Doctrine\DBAL\Connection->setTransactionIsolation(2)

#5 /volume1/web/owncloud/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 /volume1/web/owncloud/lib/private/DB/ConnectionFactory.php(143): Doctrine\DBAL\DriverManager::getConnection(Array, Object(Doctrine\DBAL\Configuration), Object(Doctrine\Common\EventManager))

#7 /volume1/web/owncloud/lib/private/Server.php(532): OC\DB\ConnectionFactory->getConnection(‘mysql’, Array)

#8 /volume1/web/owncloud/lib/composer/pimple/pimple/src/Pimple/Container.php(118): OC\Server->OC{closure}(Object(OC\Server))

#9 /volume1/web/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(108): Pimple\Container->offsetGet(‘DatabaseConnect…’)

#10 /volume1/web/owncloud/lib/private/ServerContainer.php(86): OC\AppFramework\Utility\SimpleContainer->query(‘DatabaseConnect…’)

#11 /volume1/web/owncloud/lib/private/Server.php(1220): OC\ServerContainer->query(‘DatabaseConnect…’)

#12 /volume1/web/owncloud/lib/private/Server.php(406): OC\Server->getDatabaseConnection()

#13 /volume1/web/owncloud/lib/composer/pimple/pimple/src/Pimple/Container.php(118): OC\Server->OC{closure}(Object(OC\Server))

#14 /volume1/web/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(108): Pimple\Container->offsetGet(‘AppConfig’)

#15 /volume1/web/owncloud/lib/private/ServerContainer.php(86): OC\AppFramework\Utility\SimpleContainer->query(‘AppConfig’)

#16 /volume1/web/owncloud/lib/private/Server.php(1150): OC\ServerContainer->query(‘AppConfig’)

#17 /volume1/web/owncloud/lib/private/Server.php(587): OC\Server->getAppConfig()

#18 /volume1/web/owncloud/lib/composer/pimple/pimple/src/Pimple/Container.php(118): OC\Server->OC{closure}(Object(OC\Server))

#19 /volume1/web/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(108): Pimple\Container->offsetGet(‘AppManager’)

#20 /volume1/web/owncloud/lib/private/ServerContainer.php(86): OC\AppFramework\Utility\SimpleContainer->query(‘AppManager’)

#21 /volume1/web/owncloud/lib/private/Server.php(1418): OC\ServerContainer->query(‘AppManager’)

#22 /volume1/web/owncloud/lib/private/legacy/app.php(343): OC\Server->getAppManager()

#23 /volume1/web/owncloud/lib/private/legacy/app.php(107): OC_App::getEnabledApps()

#24 /volume1/web/owncloud/lib/base.php(585): OC_App::loadApps(Array)

#25 /volume1/web/owncloud/lib/base.php(1005): OC::init()

#26 /volume1/web/owncloud/console.php(64): require_once(’/volume1/web/ow…’)

#27 /volume1/web/owncloud/occ(11): require_once(’/volume1/web/ow…’)

Server configuration

Operating system:

Synology DSM 6

Web server:

Apache 2.2


MariaDB 5.5

PHP version:
PHP 7.3

I have moved from PHP 5.6 for this upgrade.

ownCloud version: (see ownCloud admin page)

OC 10.3.1

Updated from an older ownCloud or fresh install:

OC 10.0.10

Where did you install ownCloud from:

from official download page

Signing status (ownCloud 9.0 and above):

Login as admin user into your ownCloud and access 
paste the results into https://gist.github.com/ and puth the link here.

The content of config/config.php:

$CONFIG = array (
  'instanceid' => '999999',
  'passwordsalt' => '999999',
  'secret' => '999999',
  'trusted_domains' => 
  array (
    0 => 'domain.fr',
    1 => 'www.domain.fr',
    2 => '',
    3 => 'cloud.domain.fr',
  'datadirectory' => '/volume1/owncloud/data',
  'overwrite.cli.url' => 'https://cloud.domain.fr',
  'htaccess.RewriteBase' => '/',
  'dbtype' => 'mysql',
  'version' => '',
  'dbname' => 'owncloud',
  'dbhost' => 'localhost',
  'dbtableprefix' => '',
  'dbuser' => 'owncloud',
  'dbpassword' => '99999',
  'files_external_allow_create_new_local' => true,
  'logtimezone' => 'UTC',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_from_address' => '99999999',
  'mail_domain' => 'zoho.eu',
  'mail_smtphost' => 'smtp.zoho.eu',
  'mail_smtpauth' => 1,
  'mail_smtpport' => '465',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpname' => 'XXXXXXXX',
  'mail_smtppassword' => '99999999',
  'mail_smtpsecure' => 'ssl',
  'theme' => '',
  'loglevel' => 2,
  'maintenance' => false,
  'trashbin_retention_obligation' => 'auto',
  'updater.secret' => '$SECRET$',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => 6379,
    'timeout' => 0,

Log in to the web-UI with an administrator account and click on
‘admin’ -> ‘Generate Config Report’ -> ‘Download ownCloud config report’
This report includes the config.php settings, the list of activated apps
and other details in a well sanitized form.


If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your ownCloud installation folder

ATTENTION: Do not post your config.php file in public as is. Please use one of the above
methods whenever possible. Both, the generated reports from the web-ui and from occ config:list
consistently remove sensitive data. You still may want to review the report before sending.
If done manually then it is critical for your own privacy to dilligently
remove all host names, passwords, usernames, salts and other credentials before posting.
You should assume that attackers find such information and will use them against your systems.

**List of activated apps:**

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your ownCloud installation folder.

**Are you using external storage, if yes which one:** local/smb/sftp/...

**Are you using encryption:** yes/no


**Are you using an external user-backend, if yes which one:** LDAP/ActiveDirectory/Webdav/...

### Client configuration


**Operating system:**


### Logs
#### Web server error log

Insert your webserver log here

#### ownCloud log (data/owncloud.log)


Make sure that you have all necessary PHP modules installed, you can find a list in the ownCloud docs.

hello again,

for dbhost in config.pho had to replace “localhost” with “”.

ouf … :stuck_out_tongue_closed_eyes:

  • scott
1 Like


somehow i have the feeling that this is a problem somewhere at the operating system / environment level. In the past i had found the following in https://dev.mysql.com/doc/refman/8.0/en/connecting.html during the administration of my own MySQL server:

On Unix, MySQL programs treat the host name localhost specially, in a way that is likely different from what you expect compared to other network-based programs: the client connects using a Unix socket file.

It seems your MySQL server or PHP environment has some issues with this Unix socket connection, that’s why ownCloud can’t do a database connection if you’re using localhost.