Hi,
We are using postgre as a service in a docker-compose file.
The docker-compose file is the following:
and the travis file is the following:
As you can see, we are using the wait-for-it.sh script to wait for postgree to be up before performing tests.
Until recently, this method was functionning but starting from the recent days, we are getting the following error:
File "/usr/local/lib/python3.6/dist-packages/psycopg2/__init__.py", line 130, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: could not translate host name "db" to address: Name or service not known
The command "docker-compose -f docker-compose-prod.yml run --service-ports --rm web ./wait-for-it.sh db:5432 -- python3 manage.py test" exited with 1.
Any suggestions on what could be causing this issue ? Any change in Travis CI we should be aware of ?
The thing is we are using the “dns” provided by docker-compose to reach our database (ie: we are connecting to a hostname called db, not a hardcoded IP adress).
Thanks for your help. After checking the different services status, we figured out that the postgres:9.6 image has been updated and that this new version require a mendatory password at start time. This was the reason why the database was not up.