Hi. I’m having an issue with a linked container becoming unreachable from another container. I don’t know exactly at what layer the problem lies, but here is a description of my system:
I’m using Docker Cloud with one instance from AWS. I have a stack with a Postgres container (
postgres:latest) and my own container for a simple Play web app that is linked to the Postgres container (
links: - database). Everything works fine for a while.
For the last 5 days, I’m getting a notification every day around 07:00 UTC that the Play container stopped with exit code 255. The Play app crashes saying “
Cannot connect to database [default]”, “
Caused by: java.net.ConnectException: Connection timed out”. If I connect to the Play container and try to ping “database” I get
PING database.4d087578-b7f7-440e-85dc-315e6882ff2a.local.dockerapp.io (10.7.0.1): 56 data bytes ^C --- database.4d087578-b7f7-440e-85dc-315e6882ff2a.local.dockerapp.io ping statistics --- 6 packets transmitted, 0 packets received, 100% packet loss
I redeploy the database container every time this happens, and after that it becomes reachable again. Next time this happens I will take a look at the logs of the Postgres container before I redeploy, but to me it seems to be an issue with the whole container, not with Postgres itself.
Any pointers would be useful, as I’m new to Docker.