Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nextcloud unable to connect to MySQL container #636

Closed
ordinaly opened this issue Feb 2, 2019 · 0 comments
Closed

Nextcloud unable to connect to MySQL container #636

ordinaly opened this issue Feb 2, 2019 · 0 comments

Comments

@ordinaly
Copy link

ordinaly commented Feb 2, 2019

Hello,
I have recently modified the port mapping for my Nextcloud container, so I restarted the NC container and since then it is unable to connect to the MySQL DB.
Here is the output of the logs:

PHP message: PHP Fatal error: Uncaught Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Try again in /config/www/nextcloud/lib/private/DB/Connection.php:64
Stack trace:
#0 /config/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\DB\Connection->connect()
#1 /config/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#2 /config/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\DBAL\Connection->detectDatabasePlatform()
#3 /config/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\DBAL\Connection->getDatabasePlatform()
#4 /config/www/nextcloud/lib/private/DB/Connection.php(151): Doctrine\DBAL\Connection->setTransactionIsolation(2)
#5 /config/www/nextcloud/3rd

My config file:

<?php
$CONFIG = array (
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'redis',
    'port' => 6379,
  ),
  'datadirectory' => '/data',
  'instanceid' => 'ocq371i1672w',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' => 
  array (
    0 => '192.168.0.66'
  ),
  'overwrite.cli.url' => 'https://192.168.0.66',
  'dbtype' => 'mysql',
  'version' => '15.0.2.0',
  'dbname' => 'nextcloud',
  'dbhost' => 'mysql:3306',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'oc_admin2',
  'dbpassword' => '',
  'installed' => true,
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'mail_from_address' => '',
  'mail_smtpmode' => 'smtp',
  'mail_domain' => 'gmail.com',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp.gmail.com',
  'mail_smtpport' => '465',
  'mail_smtpname' => '',
  'mail_smtppassword' => '',
  'mail_smtpsecure' => 'ssl',
);

I linked the NC container to the DB container using --link mysqldb:mysql where mysqldb is the name of the mysql container. I have checked that the DB container is up and running and I am able to ping it from the NC container.

Any help is appreciated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant