Error on execution of asynchronous task:
django.db.utils.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 3047101641304 and this is thread id 3047208084584.
Solution:
Original start command (under Windows):
celery -A xxx worker -l info -P eventlet (xxx is the project name)
Modified start command, celery version 4x:
celery -A xxx worker -l info -P solo
Read More:
- Python: Django exception when executing migrate operation: django.db.utils.OperationalError: (1051, “Unknown table’xxx’”)
- [Solved] Django project locally Open Error: importerror: couldn’t import Django
- [Solved] Django Error: django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.
- [Solved] Python Django error: error: (1146, “Table ‘mydb.django_session’ doesn’t exist”)
- Django uses Mysql to report an error loading MySQL DB module: no module named ‘mysqldb’
- Django PythonConsole error: Requested setting DEFAULT_INDEX_TABLESPACE
- Django Issues: TypeError: “Settings” object is irreversible
- [Solved] Django.core.exceptions.ImproperlyConfigured: SQLite 3.9.0 or later is required (found 3.7.17).
- [Solved] Django backend processing Base64 file upload error
- [Solved] django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.Did you install mysqlclie
- [Solved] Django Error: Attributeerror: ‘wsgirequest’ object has no attribute ‘is_ajax ‘
- [Solved] Django backend error: Assertion failed: (NSViewIsCurrentlyBuildingLayerTreeForDisplay()
- Django WSGI protocol application, based on wsgiref module DIY a web framework
- Django Error: ‘polls‘ is not a registered namespace
- [Solved] django AttributeError: ‘UserComment‘ object has no attribute ‘save‘
- [Solved] from django.core.cache import cache Error
- Django CSV file Error: UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xb5 in position 0: invalid start
- [Solved] celery Startup Error: kombu.exceptions.VersionMismatch: Redis transport requires redis-py versions 3.2.0 or later. You have 2.10.6
- [Solved] Django Access to the backend error: Invalid block tag on line 98: ‘trans‘, expected ‘elif , ‘else‘或‘ endif. Did you forget