Closed kbuilds closed 4 years ago
What is that container? Is that the proxy container? Can you run:
dokku --force --trace postgres:destroy SERVICE
On a new, exposed service and gist the output?
What is the output of docker inspect 85818d0c36fd10d446fe3a6b9dcf9c818efe307e511388c7e4d334322a53aeff
?
Okay the heuristic for a stopped container here is wrong:
docker ps -f status=running --no-trunc
I'll see if I have time to investigate later.
@josegonzalez Thanks for taking the time to look into this.
In the meantime, a workaround I have been using is to simply unexpose the service:
dokku postgres:unexpose test_db
then destroy it
dokku postgres:destroy test_db
This should have been fixed in https://github.com/dokku/dokku-redis/commit/28ff40a507afd43aac96be100cdb2e71208686c4 (and related commits for each service plugin). Example output:
vagrant@dokku:~$ dokku postgres:create test_db
Waiting for container to be ready
Creating container database
Securing connection to database
=====> Postgres container created: test_db
=====> Container Information
Config dir: /var/lib/dokku/services/postgres/test_db/config
Data dir: /var/lib/dokku/services/postgres/test_db/data
Dsn: postgres://postgres:65d8d7b206747bba0102b4d9a0b7be24@dokku-postgres-test-db:5432/test_db
Exposed ports: -
Id: ca887889ba8e6173180c4bfa8bc1a7fe37338b25b208459d771100fd55a7398d
Internal ip: 172.17.0.2
Links: -
Service root: /var/lib/dokku/services/postgres/test_db
Status: running
Version: postgres:11.6
vagrant@dokku:~$ dokku postgres:expose test_db
-----> Service test_db exposed on port(s) [container->host]: 5432->32403
vagrant@dokku:~$ dokku postgres:destroy test_db
! WARNING: Potentially Destructive Action
! This command will destroy test_db Postgres service.
! To proceed, type "test_db"
> test_db
=====> Deleting test_db
=====> Stopping container
Container stopped
Removing container
Removing data
=====> Postgres container deleted: test_db
vagrant@dokku:~$
Description of problem
Using dokku version 0.13.4, when I create a new service from a plugin (i.e. redis, postgres), and expose a port on that service, I cannot destroy that service without first unexposing the service. Fails with a docker error.
How reproducible
Seems to happen every time.
Steps to Reproduce
Create a new service
dokku postgres:create test_db
Expose that service
dokku postgres:expose test_db
Try to destroy the service
dokku postgres:destroy test_db
Actual Results
The container is not removed. It appears that there is a second container which is created to expose the service to the outside world.
Expected Results
The container should be removed, along with the container which proxies the connection into the service container.
Environment Information
Ubuntu Server 16.04
dokku report APP_NAME
outputHow (deb/make/rpm) and where (AWS, VirtualBox, physical, etc.) was Dokku installed?:
Installed from the install script on the main documentation site.
Moved from https://github.com/dokku/dokku/issues/3399