Nextcloud version (eg, 27.1.6): replace me
Operating system and version (eg, Ubuntu 20.04): docker
PHP version (eg, 7.4): 8.2.16
The issue you are facing:
I updated my docker images and restarted my containers but now the app won’t connect to the database as it normally does. I’m not sure why and the logs don’t really tell me what changed that I can tell.
Is this the first time you’ve seen this error? (Y/N):
Steps to replicate it:
- Updated my docker images and restarted
The output of your Nextcloud log in Admin > Logging:
I’m not sure where to get the logs besides what docker gives me. occ
gives me some errors:
$ sudo docker compose exec --user www-data app php occ help
An unhandled exception has been thrown:
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for db failed: Name or service n
ot known in /var/www/html/lib/private/DB/Connection.php:140
Stack trace:
#0 /var/www/html/3rdparty/doctrine/dbal/src/Connection.php(1531): OC\DB\Connection->connect()
#1 /var/www/html/3rdparty/doctrine/dbal/src/Connection.php(1029): Doctrine\DBAL\Connection->getWrappedConnection()
#2 /var/www/html/lib/private/DB/Connection.php(262): Doctrine\DBAL\Connection->executeQuery('SELECT * FROM `...', Array, Array, NULL)
#3 /var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(345): OC\DB\Connection->executeQuery('SELECT * FROM `...', Array, Array)
#4 /var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php(280): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /var/www/html/lib/private/AppConfig.php(421): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /var/www/html/lib/private/AppConfig.php(187): OC\AppConfig->loadConfigValues()
#7 /var/www/html/lib/private/AppConfig.php(377): OC\AppConfig->getApps()
#8 /var/www/html/lib/private/legacy/OC_App.php(803): OC\AppConfig->getVa
The output of your config.php file in /path/to/nextcloud
(make sure you remove any identifiable information!):
<?php
$CONFIG = array (
'datadirectory' => '/var/www/html/data',
'memcache.local' => '\\OC\\Memcache\\APCu',
'instanceid' => 'xxxx',
'passwordsalt' => 'xxxx',
'secret' => 'xxxxx',
'overwriteprotocol' => 'https',
'trusted_domains' =>
array (
0 => 'xxxx',
),
'trusted_proxies' =>
array (
0 => 'xxxx',
),
'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,
),
),
'overwrite.cli.url' => 'https://xxxxx',
'check_for_working_wellknown_setup' => false,
'dbtype' => 'mysql',
'version' => '27.1.6.2',
'dbname' => 'nextcloud',
'dbhost' => 'db',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'nextcloud',
'dbpassword' => 'xxxxx',
'installed' => true,
'mail_from_address' => 'postmaster',
'logtimezone' => 'Etc/UTC',
'logdateformat' => 'Y-m-d H:i:s',
'mail_smtpmode' => 'smtp',
'mail_smtpauthtype' => 'LOGIN',
'mail_smtpsecure' => 'tls',
'mail_domain' => 'xxxx',
'mail_smtpauth' => 1,
'mail_smtphost' => 'smtp.mailgun.org',
'mail_smtpname' => 'postmaster@xxxx',
'mail_smtppassword' => 'xxxxxx',
'default_phone_region' => 'US',
'loglevel' => 0,
'maintenance' => false,
'theme' => '',
'updater.release.channel' => 'stable',
'app_install_overwrite' =>
array (
0 => 'spreed',
1 => 'twofactor_totp',
),
);
Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.
I’m not sure where the logs are on docker setups.