Getting DatabaseError: DatabaseWrapper objects created in a thread can only be used in that same thread with DRF and Postgres backend #8121
Unanswered
sumitj-supr
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, observing this error after a recent deployment. It was working fine until today and it started happening randomly after recent deployment.
Description of the error:
DatabaseError: DatabaseWrapper objects created in a thread can only be used in that same thread. The object with alias 'default' was created in thread id 140024734693120 and this is thread id 140024743085824.
Searching on Google shows that there's some bad configuration with Celery, but we're not even using Celery in our case.
Adding some important modules we're using:
After doing the deployment again (With no code changes, just a dummy deployment) this error didn't happen again.
Attaching the stacktrace:
Beta Was this translation helpful? Give feedback.
All reactions