mautic/docker-mautic

Problem with connect to Database "Access denied for user 'root'@'172.20.0.6' (using password: YES)" when trying to connect"

tomekkowalczyk opened this issue · 2 comments

Hey, I'm having trouble running the tests on DDEV Mautic. Web works no problem

Adres IP kontenera db to 172.20.0.2

image

xxx@mautic-web:/var/www/html$ bin/phpunit -d memory_limit=1G --bootstrap vendor/autoload.php --configuration app/phpunit.xml.dist --filter EmailApiControllerFunctionalTest::testSingleEmailWorkflow
PHPUnit 9.5.20 #StandWithUkraine

E                                                                   1 / 1 (100%)

Time: 00:39.772, Memory: 54.16 MB

There was 1 error:

1) Mautic\EmailBundle\Tests\Controller\Api\EmailApiControllerFunctionalTest::testSingleEmailWorkflow
Exception: mysqldump --opt -h"${:db_host}" -P"${:db_port}" -u"${:db_user}" "${:db_name}" > "${:db_backup_file}" failed with status code 2 and last line of "mysqldump: Got error: 1045: "Access denied for user 'root'@'172.20.0.6' (using password: YES)" when trying to connect
"

/var/www/html/app/bundles/CoreBundle/Test/MauticMysqlTestCase.php:233
/var/www/html/app/bundles/CoreBundle/Test/MauticMysqlTestCase.php:181
/var/www/html/app/bundles/CoreBundle/Test/MauticMysqlTestCase.php:50
/var/www/html/app/bundles/EmailBundle/Tests/Controller/Api/EmailApiControllerFunctionalTest.php:15
phpvfscomposer:///var/www/html/vendor/phpunit/phpunit/phpunit:97

ERRORS!
Tests: 1, Assertions: 3, Errors: 1.


Adres IP kontenera db to 172.20.0.2

DB_HOST=db
DB_PORT=3306
DB_NAME=test
DB_USER=root
DB_PASSWD=root
MAUTIC_TABLE_PREFIX=
MAUTIC_ENV=test
MAUTIC_ADMIN_USERNAME=admin
MAUTIC_ADMIN_PASSWORD=mautic

Almost 2 years open, did you ever get this resolved?

This issue was probably for the mautic/mautic repo, as it's related to testing of the codebase.
Most likely there was confusion that ddev uses docker images, and Mautic also has docker images.
But those Mautic images contain the production version, not a version that can be used during testing.

@SSAdvisor If you're experiencing a similar issue with running tests in DDEV, please reach out via https://forum.mautic.org/ or the Slack channel.