Sales Invoice error Log -unable to identify cause

Every most often i get the following error log generated in my error log list and cant verify the cause.

Traceback (most recent call last):
File “/home/erpdev/frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/pos.py”, line 485, in submit_invoice
si_doc.submit()
File “/home/erpdev/frappe-bench/apps/frappe/frappe/model/document.py”, line 831, in submit
self._submit()
File “/home/erpdev/frappe-bench/apps/frappe/frappe/model/document.py”, line 820, in _submit
self.save()
File “/home/erpdev/frappe-bench/apps/frappe/frappe/model/document.py”, line 256, in save
return self.save(*args, **kwargs)
File “/home/erpdev/frappe-bench/apps/frappe/frappe/model/document.py”, line 307, in save
self.run_post_save_methods()
File “/home/erpdev/frappe-bench/apps/frappe/frappe/model/document.py”, line 890, in run_post_save_methods
self.run_method(“on_submit”)
File “/home/erpdev/frappe-bench/apps/frappe/frappe/model/document.py”, line 755, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/erpdev/frappe-bench/apps/frappe/frappe/model/document.py”, line 1024, in composer
return composed(self, method, *args, **kwargs)
File “/home/erpdev/frappe-bench/apps/frappe/frappe/model/document.py”, line 1007, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/erpdev/frappe-bench/apps/frappe/frappe/model/document.py”, line 749, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/erpdev/frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py”, line 132, in on_submit
self.make_gl_entries()
File “/home/erpdev/frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py”, line 606, in make_gl_entries
update_gl_entries_after(self.posting_date, self.posting_time, warehouses, items)
File “/home/erpdev/frappe-bench/apps/erpnext/erpnext/controllers/stock_controller.py”, line 349, in update_gl_entries_after
voucher_obj = frappe.get_doc(voucher_type, voucher_no)
File “/home/erpdev/frappe-bench/apps/frappe/frappe/init.py”, line 638, in get_doc
return frappe.model.document.get_doc(*args, **kwargs)
File “/home/erpdev/frappe-bench/apps/frappe/frappe/model/document.py”, line 68, in get_doc
return controller(*args, **kwargs)
File “/home/erpdev/frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py”, line 31, in init
super(SalesInvoice, self).init(*args, **kwargs)
File “/home/erpdev/frappe-bench/apps/erpnext/erpnext/controllers/accounts_controller.py”, line 19, in init
super(AccountsController, self).init(*args, **kwargs)
File “/home/erpdev/frappe-bench/apps/frappe/frappe/model/document.py”, line 103, in init
self.load_from_db()
File “/home/erpdev/frappe-bench/apps/frappe/frappe/model/document.py”, line 140, in load_from_db
frappe.throw(
("{0} {1} not found").format(
(self.doctype), self.name), frappe.DoesNotExistError)
File “/home/erpdev/frappe-bench/apps/frappe/frappe/init.py”, line 323, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/erpdev/frappe-bench/apps/frappe/frappe/init.py”, line 309, in msgprint
_raise_exception()
File “/home/erpdev/frappe-bench/apps/frappe/frappe/init.py”, line 282, in _raise_exception
raise raise_exception(encode(msg))
DoesNotExistError: Sales Invoice SINV-07574 not found

But when checked later , the invoices are present in system …but some are missing or saved as different invoice number.
I know it might be a POS error as there are many ,
just wanted to confirm if there is anything that is done on client side while making that is causing this(like some info not mentioned) or its from the system side…

Regards,

The error is appearing while reporting future sales invoices, as you are making back dated POS/Sales Invoices. While doing reporting, system does not find some invoices whose reference is present in GL Entry.

For any reason are you deleting / modifying GL Entry manually directly from Mysql?

Hello @nabinhait,

Don’t know about back entry, just directly making invoices through pos, there isn’t any option to put date there…
And haven’t modified any gl entry manually,
The only thing i had deleted manually from sales invoice table was a sales invoice with a template item sold - had reported the problem

its not solved yet , but i am unsure that that is the cause of this…
Is there a way to check the invoices that are in back entry???
I have seen this back entry issue a couple of more times on forum.

Please advice,

Thanks