Failed to start containers: dokku.postgres.DB.ambassador
Description of problem
Can't restart exposed postgres instance without an error I am getting
root@Ubuntu-2204-jammy-amd64-base /temp_disk # dokku postgres:start lake
=====> Starting container
Error response from daemon: Cannot link to a non running container: /dokku.postgres.lake AS /dokku.postgres.lake.ambassador/postgres
Error: failed to start containers: dokku.postgres.lake.ambassador
Eventually, the container started and i needed to do expose one more time
dokku postgres:unexpose lake
dokku postgres:expose lake 5678
And everything is working!
How reproducible
dokku postgres:create lake
dokku postgres:expose lake 5678
dokku postgres:stop lake
dokku postgres:start lake
Actual Results
root@Ubuntu-2204-jammy-amd64-base /temp_disk # dokku postgres:expose tg 5678
-----> Service tg exposed on port(s) [container->host]: 5432->5678
root@Ubuntu-2204-jammy-amd64-base /temp_disk # dokku postgres:stop tg
=====> Pausing container
Container paused
Removing container
root@Ubuntu-2204-jammy-amd64-base /temp_disk # dokku postgres:start tg
=====> Starting container
Error response from daemon: Cannot link to a non running container: /dokku.postgres.tg AS /dokku.postgres.tg.ambassador/postgres
Error: failed to start containers: dokku.postgres.tg.ambassador
Expected Results
Without error
Environment Information
dokku version 0.34.7 postgres 1.37.0 enabled dokku postgres service plugin
How (deb/make) and where (AWS, VirtualBox, physical, etc.) was Dokku installed?:
physical server
I run into this issue every time I upgrade PostgreSQL containers using dokku postgres:upgrade <service>.
The ambassador container does not seem to survive the upgrade and thus the exposed port dissapears.
As a workaround I now do this:
dokku postgres:unexpose my-db
dokku postgres:upgrade my-db
dokku postgres:expose my-db 5432
@josegonzalez just ran into this upgrading my db. Would appreciate a fix or an update to the docs to note this workaround, if necessary, in the upgrade section.
@rrr2rrr I have faced the same issue for some time now. The issue is when we stop postgres, both the container and the ambassador container are supposed to be removed. But here the problem is ambassador is not being removed. A Temporary fix i got for this issue is:
dokku postgres:stop main
docker rm -f dokku.postgres.main.ambassador
dokku postgres:start main