Try ERPNext Buy Support Partners Foundation

Deadlock found when trying to submit sales order

Traceback (most recent call last):
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/app.py”, line 62, in application
response = frappe.handler.handle()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/handler.py”, line 22, in handle
data = execute_cmd(cmd)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/handler.py”, line 53, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 939, in call
return fn(*args, **newargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 19, in savedocs
doc.submit()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 831, in submit
self._submit()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 820, in _submit
self.save()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 256, in save
return self._save(*args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 307, in _save
self.run_post_save_methods()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 890, in run_post_save_methods
self.run_method(“on_submit”)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 755, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 1024, in composer
return composed(self, method, *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 1007, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 749, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py”, line 171, in on_submit
self.update_reserved_qty()
File “/home/ubuntu/frappe-bench/apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py”, line 288, in update_reserved_qty
“reserved_qty”: get_reserved_qty(item_code, warehouse)
File “/home/ubuntu/frappe-bench/apps/erpnext/erpnext/stock/stock_balance.py”, line 155, in update_bin_qty
bin.save()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 256, in save
return self._save(*args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 307, in _save
self.run_post_save_methods()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 906, in run_post_save_methods
self.save_version()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 982, in save_version
version.insert(ignore_permissions=True)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 230, in insert
self.db_insert()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 303, in db_insert
), list(d.values()))
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/database.py”, line 166, in sql
self._cursor.execute(query, values)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/cursors.py”, line 165, in execute
result = self._query(query)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/cursors.py”, line 321, in _query
conn.query(q)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 860, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 1061, in _read_query_result
result.read()
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 1349, in read
first_packet = self.connection._read_packet()
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 1018, in _read_packet
packet.check_error()
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 384, in check_error
err.raise_mysql_exception(self._data)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/err.py”, line 107, in raise_mysql_exception
raise errorclass(errno, errval)
InternalError: (1213, u’Deadlock found when trying to get lock; try restarting transaction’)

Also happened for material request. but that was solved by refreshing the browser.

Please share your version number. We have fixed quite a few deadlock issues in 10.1

1 Like

ErpNext & Frappe Versions are:
ERPNext: v10.1.4 (master)
Frappe Framework: v10.1.1 (master)

Please raise a github issue for this. CC @nabinhait

Sir,

The deadlock error is not resolve yet. I have to refresh the page and hit the submit button multiple time to submit one doctype. we are in version ERPNext: v10.1.14 (master)
and
Frappe Framework: v10.1.7 (master) Kindly do the need full.

Regards,