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

java.net.UnknownHostException: postgres - after migrating container to new host #49

Open
lulu-2021 opened this issue Apr 20, 2020 · 1 comment

Comments

@lulu-2021
Copy link

I migrated all the docker volumes with the data and am in the process of migrating the containers - but can't get bitbucket to connect with the db.

I have a postgres docker container and a bitbucket app container both have

--network="bitbucket_default"

I added these three to the bitbucket container start up command

--env="DB_HOST=bitbucket_db" \
--env="PG_HOST=bitbucket_db" \
--env="DOCKER_WAIT_HOST=bitbucket_db" \

But they didn't suffice/fix the issue - Thanks

I can connect to the postgres container - using a small container with the psql client on the same network - so clearly I am just not passing the right ENV vars to bitbucket - can you help?

HERE IS THE Java (console) error - it's trying to talk to an host called postgres that does not exist..

JAVA start up error
org.postgresql.util.PSQLException: The connection attempt failed.
at org.postgresql.Driver$ConnectThread.getResult(Driver.java:401)
at org.postgresql.Driver.connect(Driver.java:259)
....
Caused by: java.net.UnknownHostException: postgres

@ckotte
Copy link
Contributor

ckotte commented May 31, 2020

Are you able to ping postgres in the bitbucket container??

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

2 participants