-
Notifications
You must be signed in to change notification settings - Fork 725
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 in TravisCI causes linking db's to fail #4842
Comments
Some users report good results with adding |
@BanzaiMan I tried your solution on a different branch that I used to try docker without docker-compose on, but unfortunately still the same result. https://travis-ci.org/inooid/BoydDamesAPI-for-portfolio/builds/82217186 Could it be a firewall issue? Does Travis automatically enforce some ruling around ports or 'external' containers (so to speak)? The linking is done properly, because the It seems like either the db container gets shut down as soon as the tests start or the connection is blocked by some sort of firewall/external IP that can't be accessed. Thoughts? |
Running into this as well. Attempting to add the |
I'm also experiencing this issue. Can not connect to ports on the docker container. |
I wrote a script that waits for the postgres container to be fully started and ready to use, but the instance still can't connect to the Docker db container. I got my tests working on Codeship, but not on Travis, so it has to be something Travis related. |
Same problem here, I can't get any connection to my postgres container in travis, in local test its working perfectly.
|
@pando85 👍 |
Related to the solution by @pando85 introducing a sleep to wait for the postgres container to start, I found that at times even 20 seconds weren't sufficient in my case, causing the build to error - thus I'm now using this to detect the linked container's availability:
|
Ran into same issue with docker-compose: https://travis-ci.org/gnhuy91/django-tutorial-docker/builds/119759198 |
same issue here: https://travis-ci.org/erikdstock/tipjar/builds/145257098 |
I am also running into this same problem. |
I am too having this issue. I have two services defined in my docker-compose.yml file (an application and a database service) and my application is unable to connect to the database. Any ideas here? I'd hate to not use Travis CI because of this. Thanks! |
Similar trouble here, my build fails with:
Remapping the postgres port to something different seems to allow it to start up, but is not ideal. |
I haven't tried |
I'm having this same issue as well, I've spent many hours trying to debug and tried various options I saw in other travis-ci issues. Nothing seems to work, it does look like some sort of port restrictions are being imposed within travis since the same docker scripts work just fine in other environments. Key issue: I have a mysql container at port 3301 and an app container. I need the app container to be able to hit the mysql container. Really pulling my hair out on this one. Adding mysql to the host script could be problematic as well since mysql would be running at 127.0.0.1 and the container would not be able to hit it. Is my only option to create a completely self contained container that run all of the services in the same container? That should work just fine but it really goes against how to best use docker and means I have to manage a separate container just for travis. |
Patiently waiting on a solution! Would really like to run django test (manage.py test) in Travis without changing docker-compose.yml or the config that works locally and up on aws. Django test attempts to create test database for alias 'default', but
config:
Error Log:
|
Resolved as proposed by olalonde user under https://discuss.circleci.com/t/how-to-permanently-shutdown-circleci-default-postgres-mongodb-etc/7329/4
See my working travis.yml under |
Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please do feel free to either reopen this issue or open a new one. We'll gladly take a look again! You can read more here: https://blog.travis-ci.com/2018-03-09-closing-old-issues |
Unfortunately, this issue is not stale! I've applied @danielmacho72 's workaround but it should really be handled by the Travis team. |
Workaround suggested here: travis-ci/travis-ci#4842 (comment)
* Update parameters of ``storeInstances`` API method * Fix request helper functions for POST method * Create dcm4chee-docker-compose.yml * Create dcm4chee-docker-compose.env * Update dcm4chee-docker-compose.yml * Try to run dcm4chee with docker-compose for travis * Fix name of environment file for docker compose * try changing postgres port Address this error from travis: ``` Digest: sha256:4208948ecf63c111ea40a367bb3af7a61b8be235587e597b762480eaeeeca014 Status: Downloaded newer image for dcm4che/dcm4chee-arc-psql:5.13.3 Creating dicomwebclient_db_1 ... Creating dicomwebclient_ldap_1 ... Creating dicomwebclient_ldap_1 Creating dicomwebclient_db_1 ERROR: for dicomwebclient_db_1 Cannot start service db: driver failed programming external connectivity on endpoint dicomwebclient_db_1 (e37d2be345d7e4edd272cc5f2c05c3d351f5386848b3749d00f96b8fe8c1a121): Error starting userland proxy: listen tcp 0.0.0.0:5432: bind: address already in use ERROR: for db Cannot start service db: driver failed programming external connectivity on endpoint dicomwebclient_db_1 (e37d2be345d7e4edd272cc5f2c05c3d351f5386848b3749d00f96b8fe8c1a121): Error starting userland proxy: listen tcp 0.0.0.0:5432: bind: address already in use ERROR: Encountered errors while bringing up the project. ``` * Switch dcm4chee postgres port back to default * Put dcm4chee docker into daemon mode for testing * Add loop to wait for server to come up (travis) * Shutdown system postgres in travis Workaround suggested here: travis-ci/travis-ci#4842 (comment) * Avoid travis build failure Only include commands that are meant to succeed * Add test framework TODO: port the client to be node compatible with fetch instead of XMLHttpRequest. * Run the npm test in travis * Install before testing * Add tape dependency for testing * Fix dependencies and lock for tests * Add tape for running tests
It interferes with the one we want to use/create from our docker environment. See: travis-ci/travis-ci#4842 (comment)
It interferes with the one we want to use/create from our docker environment. See: travis-ci/travis-ci#4842 (comment)
It interferes with the one we want to use/create from our docker environment. See: travis-ci/travis-ci#4842 (comment)
Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue in 7 days. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please respond before the issue is closed, or open a new one after. We'll gladly take a look again! You can read more here: https://blog.travis-ci.com/2018-03-09-closing-old-issues |
Unfortunately, this issue is not stale! |
sharing my solution originally i hard coded the postgres host with then i change the host to
|
Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue in 7 days. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please respond before the issue is closed, or open a new one after. We'll gladly take a look again! You can read more here: https://blog.travis-ci.com/2018-03-09-closing-old-issues |
The error output from Travis job log:
For anyone trying to test Dockerized Django with Postgres web apps in Travis & still stuck with this Postgress connection issue, introducing a delay in the
See this post in stackoverflow. If you want an example of |
After spending two days now trying to get my docker images to run on TravisCI, I am asking for your help. After eliminating the problems that were issued here: #4778 about the
iptables
that failed I ran into a database connection problem that I cannot reproduce on other machines.The repo it's about:
https://travis-ci.org/inooid/BoydDamesAPI-for-portfolio/builds/81777509
I am trying to run my specs, but it keeps failing to connect to the database. I have tried using with and without environment variables inside of my
database.yml
, but neither seems to work. I also tried running it on differentdocker-machine
's, but everywhere it seems to run. I've checked the hosts file and thedb
hostname is properly set by docker.Is the database container being shutdown before the
docker-compose run app rake
task is being called? I tried runningdocker-compose up -d db
in abefore_install
hook, so I can make sure that the postgres database is running, but still no results.The text was updated successfully, but these errors were encountered: