erpnext
erpnext copied to clipboard
LCV: Too many writes in one request. Please send smaller requests
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
- Create an LCV in ERPNext with 1,000's of transactions
- Submit using enqueue as front end submit will definitely timeout
- Wait for the error to show up on the comments
Observed result
Error comes in the comments indicating
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
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.
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!