django-filer
django-filer copied to clipboard
rare `Deadlock found when trying to get lock; try restarting transaction` when uploading
This doesnt normaly happen, and I cant say when exactly it happens, I only get these in Sentry and exception e-mails... Also, clients havent complained yet about anything not working, so it might be one of those "nervous double clicking somewhere" issues. Nevertheless, throws an exception.
OperationalError at /de/admin/filer/clipboard/operations/upload/1/
(1213, 'Deadlock found when trying to get lock; try restarting transaction')
filer 1.3, django 1.11, happens with python 3.5 and 2.7 might be related to one of the dependencies, polymorphic/mptt?
Full traceback:
File "/project/path/virtualenv/lib/python3.5/site-packages/django/db/backends/utils.py" in execute
64. return self.cursor.execute(sql, params)
File "/project/path/virtualenv/lib/python3.5/site-packages/django/db/backends/mysql/base.py" in execute
101. return self.cursor.execute(query, args)
File "/project/path/virtualenv/lib/python3.5/site-packages/MySQLdb/cursors.py" in execute
250. self.errorhandler(self, exc, value)
File "/project/path/virtualenv/lib/python3.5/site-packages/MySQLdb/connections.py" in defaulterrorhandler
50. raise errorvalue
File "/project/path/virtualenv/lib/python3.5/site-packages/MySQLdb/cursors.py" in execute
247. res = self._query(query)
File "/project/path/virtualenv/lib/python3.5/site-packages/MySQLdb/cursors.py" in _query
411. rowcount = self._do_query(q)
File "/project/path/virtualenv/lib/python3.5/site-packages/MySQLdb/cursors.py" in _do_query
374. db.query(q)
File "/project/path/virtualenv/lib/python3.5/site-packages/MySQLdb/connections.py" in query
277. _mysql.connection.query(self, query)
The above exception ((1213, 'Deadlock found when trying to get lock; try restarting transaction')) was the direct cause of the following exception:
File "/project/path/virtualenv/lib/python3.5/site-packages/django/core/handlers/exception.py" in inner
41. response = get_response(request)
File "/project/path/virtualenv/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
187. response = self.process_exception_by_middleware(e, request)
File "/project/path/virtualenv/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
185. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/project/path/virtualenv/lib/python3.5/site-packages/django/views/decorators/csrf.py" in wrapped_view
58. return view_func(*args, **kwargs)
File "/project/path/virtualenv/lib/python3.5/site-packages/filer/admin/clipboardadmin.py" in ajax_upload
114. file_obj.save()
File "/project/path/virtualenv/lib/python3.5/site-packages/filer/models/imagemodels.py" in save
53. super(Image, self).save(*args, **kwargs)
File "/project/path/virtualenv/lib/python3.5/site-packages/filer/models/abstract.py" in save
74. super(BaseImage, self).save(*args, **kwargs)
File "/project/path/virtualenv/lib/python3.5/site-packages/filer/models/filemodels.py" in save
194. super(File, self).save(*args, **kwargs)
File "/project/path/virtualenv/lib/python3.5/site-packages/polymorphic/models.py" in save
74. return super(PolymorphicModel, self).save(*args, **kwargs)
File "/project/path/virtualenv/lib/python3.5/site-packages/django/db/models/base.py" in save
808. force_update=force_update, update_fields=update_fields)
File "/project/path/virtualenv/lib/python3.5/site-packages/django/db/models/base.py" in save_base
838. updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
File "/project/path/virtualenv/lib/python3.5/site-packages/django/db/models/base.py" in _save_table
924. result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
File "/project/path/virtualenv/lib/python3.5/site-packages/django/db/models/base.py" in _do_insert
963. using=using, raw=raw)
File "/project/path/virtualenv/lib/python3.5/site-packages/django/db/models/manager.py" in manager_method
85. return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/project/path/virtualenv/lib/python3.5/site-packages/django/db/models/query.py" in _insert
1076. return query.get_compiler(using=using).execute_sql(return_id)
File "/project/path/virtualenv/lib/python3.5/site-packages/django/db/models/sql/compiler.py" in execute_sql
1112. cursor.execute(sql, params)
File "/project/path/virtualenv/lib/python3.5/site-packages/django/db/backends/utils.py" in execute
64. return self.cursor.execute(sql, params)
File "/project/path/virtualenv/lib/python3.5/site-packages/django/db/utils.py" in __exit__
94. six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/project/path/virtualenv/lib/python3.5/site-packages/django/utils/six.py" in reraise
685. raise value.with_traceback(tb)
File "/project/path/virtualenv/lib/python3.5/site-packages/django/db/backends/utils.py" in execute
64. return self.cursor.execute(sql, params)
File "/project/path/virtualenv/lib/python3.5/site-packages/django/db/backends/mysql/base.py" in execute
101. return self.cursor.execute(query, args)
File "/project/path/virtualenv/lib/python3.5/site-packages/MySQLdb/cursors.py" in execute
250. self.errorhandler(self, exc, value)
File "/project/path/virtualenv/lib/python3.5/site-packages/MySQLdb/connections.py" in defaulterrorhandler
50. raise errorvalue
File "/project/path/virtualenv/lib/python3.5/site-packages/MySQLdb/cursors.py" in execute
247. res = self._query(query)
File "/project/path/virtualenv/lib/python3.5/site-packages/MySQLdb/cursors.py" in _query
411. rowcount = self._do_query(q)
File "/project/path/virtualenv/lib/python3.5/site-packages/MySQLdb/cursors.py" in _do_query
374. db.query(q)
File "/project/path/virtualenv/lib/python3.5/site-packages/MySQLdb/connections.py" in query
277. _mysql.connection.query(self, query)
Exception Type: OperationalError at /de/admin/filer/clipboard/operations/upload/1/
Exception Value: (1213, 'Deadlock found when trying to get lock; try restarting transaction')
Request information:
We have the same issue from time to time.
Could have, based on our observation, something to do with the amount of images uploaded in parallel.
did not get it anymore for a very long time now. your assumption seems somehow stringent - processing larger files for example takes some time (calculating sha1, thumbs), so when in the meantime a new file gets uploaded...hm.
Indeed, file size could be a thing as well.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
long time no see for this one. how is yours going @philippeowagner ?
This will now be closed due to inactivity, but feel free to reopen it.