Skip to content
This repository has been archived by the owner on Sep 4, 2021. It is now read-only.

App deletion fails when postgres resources are still in use #2376

Closed
josephglanville opened this issue Jan 18, 2016 · 3 comments
Closed

App deletion fails when postgres resources are still in use #2376

josephglanville opened this issue Jan 18, 2016 · 3 comments

Comments

@josephglanville
Copy link
Contributor

Postgres likes to refuse to delete databases that still have open connections.
There is 2 possible fixes for this issue, we either scale down all the process types for the application we are trying to delete first before deleting the resource (which should solve this class of problem).
Or we can solve it specifically for postgres by using the superuser to deny connections to the database and also sever existing connections.

@titanous
Copy link
Contributor

Killing all of the app processes first seems like a good idea (we should also nuke one-off processes).

@NeilW
Copy link

NeilW commented Jan 28, 2016

Is this issue likely to be the cause of the app delete failure I came across during testing today?

neil@ubuntu-vm:~/Dev/go-flynn-example$ flynn delete
Are you sure you want to delete the app "goexample"? (yes/no): yes
unknown_error: Something went wrong

@josephglanville
Copy link
Contributor Author

@NeilW if it was using a postgres resource and the app was still scaled up. almost certainly yes.

To work around in the meantime you can simple scale your app down to zero before trying to remove the resource or delete the app. Once either of the 2 changes above land deletion will just work.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants