-
Notifications
You must be signed in to change notification settings - Fork 257
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
docker-compose networking issue cannot connect to the database server #140
Comments
Hi @vsotirasqmplus,
when you issue
IINW you're running Docker Engine on top of CentOS/RHEL 8: isn't it? TIA, |
After cloning moodle in /tmp/moodle directory I try to follow the proposed way to do some tests: export PATH=$PATH:~/dev/moodle-docker-compose/bin Show docker containers and their IP addressesdocker ps -q | xargs -n 1 docker inspect --format '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}} {{ .Name }}' | sed 's/ // /' Initialize Moodle database for manual testingmoodle-docker-compose exec webserver php admin/cli/install_database.php --agree-license --fullname="Docker moodle" --shortname="docker_moodle" --adminpass="test" --adminemail="admin@example.com" Initialize behat environmentmoodle-docker-compose exec webserver php admin/tool/behat/cli/init.php [..]Run behat testsmoodle-docker-compose exec -u www-data webserver php admin/tool/behat/cli/run.php --tags=@auth_manual Initialize phpunit environmentmoodle-docker-compose exec webserver php admin/tool/phpunit/cli/init.php [..]Run phpunit testsmoodle-docker-compose exec webserver vendor/bin/phpunit auth_manual_testcase auth/manual/tests/manual_test.php moodle-docker-compose downAnd this is what I get: moodle-docker-compose_db_1 is up-to-date Error: Database connection failed It is possible that the database is overloaded or otherwise not running properly. The site administrator should also check that the database details have been correctly specified in config.php !!!Debug info: Error code: dbconnectionfailed
It is possible that the database is overloaded or otherwise not running properly. The site administrator should also check that the database details have been correctly specified in config.php !!!Debug info: Error code: dbconnectionfailed
Initialising Moodle PHPUnit test environment... |
Here is the script |
Here is the log entries |
Hi @vsotirasqmplus ,
Tested using the latest code from Note: HTH, |
I was driving myself mad:
|
TNX @vsotirasqmplus for sharing the solution! FYI I still use CentOS 7 to host the Docker Engine, waiting for HTH, |
Should this not become part of the requirements declaration to avoid assumptions for others too? |
Hi @vsotirasqmplus, Let Moodle HQ tell his thoughts about your proposal. HTH, |
Creating network "moodle-docker_default" with the default driver
Creating moodle-docker_db_1 ... done
Creating moodle-docker_selenium_1 ... done
Creating moodle-docker_mailhog_1 ... done
Creating moodle-docker_exttests_1 ... done
Creating moodle-docker_webserver_1 ... done
!!!
Error: Database connection failed
It is possible that the database is overloaded or otherwise not running properly.
The site administrator should also check that the database details have been correctly specified in config.php
!!!Debug info:
Warning: pg_connect(): Unable to connect to PostgreSQL server: could not connect to server: No route to host
Is the server running on host "db" (172.26.0.4) and accepting
TCP/IP connections on port 5432? in [dirroot]/lib/dml/pgsql_native_moodle_database.php on line 176
Error code: dbconnectionfailed
Stack trace: * line 187 of /lib/dml/pgsql_native_moodle_database.php: dml_connection_exception thrown
moodle-docker-compose commit: origin/HEAD @ 50ec4a0
docker --version: Docker version 19.03.13, build 4484c46d9d
docker-compose --version: docker-compose version 1.25.0, build 0a186604
uname : Linux 4.18.0-193.19.1.el8_2.x86_64
The text was updated successfully, but these errors were encountered: