erpnext icon indicating copy to clipboard operation
erpnext copied to clipboard

LCV: Too many writes in one request. Please send smaller requests

Open aakvatech opened this issue 3 years ago • 1 comments

Description of the issue

The error "Too many writes in one request. Please send smaller requests" comes in long running transactions that are not explicitely allowed to commit mid way.

It does make sense to have explicity definition but the problem created by very large transactions

Context information (for bug reports)

ERPNExt Landed Cost Voucher with 1,000's of parts

Submitting such LCVs on front end fails with Timeout. On enqueue of such transactions they fail with "Too many writes in one request. Please send smaller requests"

Output of bench version

erpnext 13.5.0
frappe 13.5.0

Steps to reproduce the issue

  1. Create an LCV in ERPNext with 1,000's of transactions
  2. Submit using enqueue as front end submit will definitely timeout
  3. Wait for the error to show up on the comments

Observed result

Error comes in the comments indicating image

Expected result

No comments should show, but it should be automatically committed.

Stacktrace / full error message

No stack trace, only error on Commit

Additional information

It affects all stock transactions, even Purchase Receipts with large number of records in single receipts fail. Only way to bypass is to change frappe code at line https://github.com/frappe/frappe/blob/7c5624dd56a4ce4e22b547df6e5de2eef7a568f9/frappe/database/database.py#L242

if self.transaction_writes > 200000:

should be allowed 10 fold to allow muliple writes for such large data set. Or else do not allow large data set in a single Document (child table)

OS version / distribution, Frappe install method, etc. FrappeCloud version 13.5.0

aakvatech avatar Jun 18 '21 14:06 aakvatech

currently ORM handle child table insert one sql insert per child table row, technically it can be done by one insert per child table, this way the mentioned error can be resolved.

szufisher avatar Jun 21 '21 08:06 szufisher

We no longer provide support for version 13 or older.

Kindly upgrade to version 14 or 15, then refresh and check again because lots of bugs fixed in the new version.

Version EOL Branch
Version 12 End of 2022 version-12
Version 13 End of 2023 version-13
Version 14 End of 2024 (planned) version-14
Version 15 End of 2026 (planned) version-15
Bleeding edge N/A develop

For more information, please refer to the guidelines.

Thank You!

Nihantra-Patel avatar Mar 19 '24 08:03 Nihantra-Patel