Bench update give this error:
frappe.exceptions.ValidationError: Too many writes in one request. Please send smaller requests
Any solution around that error?
These tables have grown to big: tabVersion, tabDeleted Document, tabCommunication (2Million records) and tabEmail Queue.
Can I safely empty those table maybe to reduce the size of the DB if that’s the reason
If all the above fails, is there a way to reverse back to the state before bench update? So far the site is stuck at
Digging into source code I found this:
if query and query.strip().lower() in ('commit', 'rollback'):
self.transaction_writes = 0
if query[:6].lower() in ('update', 'insert', 'delete'):
self.transaction_writes += 1
if self.transaction_writes > 200000:
frappe.throw(_("Too many writes in one request. Please send smaller requests"), frappe.ValidationError)
def fetch_as_dict(self, formatted=0, as_utf8=0):
"""Internal. Converts results to dict."""
result = self._cursor.fetchall()
ret = 
keys = [column for column in self._cursor.description]
for r in result:
values = 
And setting this
self.auto_commit_on_many_writes = True can potentially solve the problem.
Next tasks is 1) to know how to initialize that variable globally or 2) Do witch patch/file I need to put that line into
Any lead will be appreciated
I added the code into the file itself and then
bench update --patch did it
There’s actually already a line in the file like this:
self.auto_commit_on_many_writes = 0
All you need to do is change the 0 to 1
We are expecting to fix this by sets of PR to stock related transcations and optimizing them to reduce the number of pending commits or merging multiple commis into a single commit.
We will sponsor the PR to optimize teh stock transaction that requires 1,000’s to 10,000’s of parts in Delivery Note, Purchase Receipt, Landed Cost Vouchers.
Having more than 1,000 items in stock transactions is pretty common in our part of the world where businesses don’t focus on what they want to sell, but want to sell anything and everything.
Please comment or like this post so that we know who else is interested or affected by this problem.
Why don’t we put it as a global Frappe parameter in the interface for administrators to be set according to the platform size?