I have a multi site environment, and suddenly after 5 months working, scheduled jobs of type repost_item_valuation.repost_entries are failing.
Yesterday I created a new site and after some minutes, the problem happens.
Scheduled jobs of other types are working. I already checked and the scheduler is enabled. I’m using the ERPNext version “v14.27.0”.
The error in the details of a repost_item_valuation.repost_entries is:
Traceback (most recent call last):
File "apps/erpnext/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py", line 200, in repost
repost_sl_entries(doc)
File "apps/erpnext/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py", line 230, in repost_sl_entries
repost_future_sle(
File "apps/erpnext/erpnext/stock/stock_ledger.py", line 227, in repost_future_sle
obj = update_entries_after(
^^^^^^^^^^^^^^^^^^^^^
File "apps/erpnext/erpnext/stock/stock_ledger.py", line 385, in __init__
self.initialize_previous_data(self.args)
File "apps/erpnext/erpnext/stock/stock_ledger.py", line 416, in initialize_previous_data
previous_sle = get_previous_sle_of_current_voucher(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/erpnext/erpnext/stock/stock_ledger.py", line 1138, in get_previous_sle_of_current_voucher
sle = frappe.db.sql(
^^^^^^^^^^^^^^
File "apps/frappe/frappe/database/database.py", line 244, in sql
self._cursor.execute(query, values)
File "env/lib/python3.11/site-packages/pymysql/cursors.py", line 151, in execute
query = self.mogrify(query, args)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "env/lib/python3.11/site-packages/pymysql/cursors.py", line 129, in mogrify
query = query % self._escape_args(args, conn)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "env/lib/python3.11/site-packages/pymysql/cursors.py", line 104, in _escape_args
return {key: conn.literal(val) for (key, val) in args.items()}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "env/lib/python3.11/site-packages/pymysql/cursors.py", line 104, in <dictcomp>
return {key: conn.literal(val) for (key, val) in args.items()}
^^^^^^^^^^^^^^^^^
File "env/lib/python3.11/site-packages/pymysql/connections.py", line 530, in literal
return self.escape(obj, self.encoders)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "env/lib/python3.11/site-packages/pymysql/connections.py", line 523, in escape
return converters.escape_item(obj, self.charset, mapping=mapping)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "env/lib/python3.11/site-packages/pymysql/converters.py", line 23, in escape_item
val = encoder(val, charset, mapping)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "env/lib/python3.11/site-packages/pymysql/converters.py", line 30, in escape_dict
raise TypeError("dict can not be used as parameter")
TypeError: dict can not be used as parameter
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "apps/frappe/frappe/core/doctype/scheduled_job_type/scheduled_job_type.py", line 117, in execute
frappe.get_attr(self.method)()
File "apps/erpnext/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py", line 344, in repost_entries
repost(doc)
File "apps/erpnext/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py", line 221, in repost
notify_error_to_stock_managers(doc, message)
File "apps/erpnext/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py", line 317, in notify_error_to_stock_managers
frappe.sendmail(recipients=recipients, subject=subject, message=message)
File "apps/frappe/frappe/__init__.py", line 735, in sendmail
builder.process(send_now=now)
File "apps/frappe/frappe/email/doctype/email_queue/email_queue.py", line 685, in process
queue_data = self.as_dict(include_recipients=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/email/doctype/email_queue/email_queue.py", line 726, in as_dict
email_account = self.get_outgoing_email_account()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/email/doctype/email_queue/email_queue.py", line 594, in get_outgoing_email_account
self._email_account = EmailAccount.find_outgoing(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/email/doctype/email_account/email_account.py", line 43, in wrapper_cache_email_account
matched_accounts = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/email/doctype/email_account/email_account.py", line 323, in find_outgoing
frappe.throw(
File "apps/frappe/frappe/__init__.py", line 548, in throw
msgprint(
File "apps/frappe/frappe/__init__.py", line 509, in msgprint
_raise_exception()
File "apps/frappe/frappe/__init__.py", line 455, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.OutgoingEmailError: Please setup default Email Account from Setup > Email > Email Account
Anyone has any idea how to solve that? Thank you in advance!