ERPNext.com Frappe Cloud Support Partners Foundation Frappe School

Error: frappe.utils.global_search.rebuild_for_doctype

Installed Apps:

ERPNext: v12.24.0 (version-12)
Frappe Framework: v12.21.1 (version-12)

I am in the process of eliminating duplicates from our Items and hence merging documents. However, I am getting the following error in the logs each time I do so:

Title
frappe.utils.global_search.rebuild_for_doctype
Error
{‘site’: ‘site1’, ‘method’: <function rebuild_for_doctype at 0x7f84608e7a60>, ‘event’: None, ‘job_name’: ‘frappe.utils.global_search.rebuild_for_doctype’, ‘kwargs’: {‘doctype’: ‘Item’}, ‘user’: ‘sam.mahendru@gmail.com’, ‘is_async’: True, ‘retry’: 0, ‘log’: <function log at 0x7f84605185e0>, ‘method_name’: ‘frappe.utils.global_search.rebuild_for_doctype’}
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/background_jobs.py”, line 102, in execute_job
method(**kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/global_search.py”, line 131, in rebuild_for_doctype
d = frappe.get_doc(doctype, doc.name)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 765, in get_doc
doc = frappe.model.document.get_doc(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 71, in get_doc
return controller(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/website_generator.py”, line 16, in init
super(WebsiteGenerator, self).init(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 106, in init
self.load_from_db()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 166, in load_from_db
self.set(df.fieldname, [])
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 136, in set
self.extend(key, value)
File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/rq/timeouts.py”, line 63, in handle_death_penalty
raise self._exception('Task exceeded maximum timeout value ’
rq.timeouts.JobTimeoutException: Task exceeded maximum timeout value (300 seconds)

The merge appears to have completed successfully on the front end. However, I am facing the issue of having background jobs piling up.

I would appreciate any help to resolve this.

Can anyone help with this?