Error while bench frappe --latest

We are getting this trace while updating sites with latest code:

Traceback (innermost last):

  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/notification_count/", line 94, in delete_notification_count_for
    frappe.db.sql("""delete from `tabNotification Count` where for_doctype = %s""", (doctype,))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 110, in sql
    self._cursor.execute(query, values)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/", line 205, in execute
    self.errorhandler(self, exc, value)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
 OperationalError: (1213, 'Deadlock found when trying to get lock; try restarting transaction') 

Anyone’s seen the error before? Any advise? Thanks!

Kill your mysql processes and run again

do show processlist in your mysql console
then kill