dokku / dokku-postgres

a postgres plugin for dokku
MIT License
491 stars 97 forks source link

Failed to start containers: dokku.postgres.DB.ambassador #322

Open rrr2rrr opened 3 months ago

rrr2rrr commented 3 months ago

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

conscribtor commented 3 months ago

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