New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
psycopg2.OperationalError: database "devdb" is being accessed by other users #5921
Comments
Hello @aubricus, |
Thanks for responding so quickly. Unfortunately my dev server is not running. I've also tested this locally through many docker client / container rebuilds and computer restarts to make sure there's no weird connection to the db just hanging around. This feels related to the fact that (for reasons I fail to understand) that If it's useful I can try to put together a minimal build that replicates the issue. |
The OperationalError is raised by the command itself not by django CMS, this is why the code you linked to does not handle it. If you can, please provide us with docker image or something packaged which we can then use to reproduce this. |
@czpython Thanks again. I will put something together to reproduce the issue this week / coming weekend. |
Hello @aubricus, |
@czpython Hey! Been getting just crushed by work. Will make some time this weekend. Thanks for checking in! |
Welp. Just made some progress, actually :). I created this workaround, that overrides the reset_db command and disables system checks (as documented here). This prevents the Ultimately though, it feels like an issue with django_extensions needing to either disable system checks for I will file an issue over at django_extensions as well. Feel free to close this issue if you like. Thanks! |
I encounter similar issue within my own project. However, I found out that |
Summary
I am hitting this error when using
reset_db
fromdjango-extensions
.This is happening when I've created a bare cms apphook application (i.e., just defines a CMSApp extension and registers via apphook_pool.register).
I've tracked the problem down to these lines in appresolover.py: https://github.com/divio/django-cms/blob/release/3.4.x/cms/appresolver.py#L186-L192
Looking at the code I would expect it catch the Operational error in the try block but it doesn't (for me).
It's worth noting that I tried in several places to just catch any Exception at all and still hit this error.
Thanks very much for taking the time to help.
Here's the full error stack trace:
Expected behaviour
python manage.py reset_db
does not throw an error.Actual behaviour
python manage.py reset_db
throws an errorEnvironment
This is happening on my local development environment running in a docker (Alpine Linux 3.4.4) container that has python installed, and a db container running Debian GNU/Linux 8 (jessie) and Postgres 9.6.1.
The text was updated successfully, but these errors were encountered: