Email attachments result in "File not found" when trying to send

Hi guys,

I have installed the latest ERPNext and everything seems to be working properly except email attachments. For instance, when a “lead” comes in from email and we try to respond by attaching anything to the email reply, the system instantly errors with “File not found”.

Here’s an example:

“attachments”: [
“bcc”: [],
“cc”: [],
“communication_name”: “462d63b464”,
“lang”: “en”,
“print_format”: “”,
“print_html”: “”,
“recipients”: [
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/communication/”, line 491, in sendmail
recipients=recipients, cc=cc, bcc=bcc)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/communication/”, line 198, in _notify
_notify(self, print_html, print_format, attachments, recipients, cc, bcc)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/communication/”, line 148, in _notify
prepare_to_notify(doc, print_html, print_format, attachments)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/communication/”, line 283, in prepare_to_notify
_file = frappe.get_doc(“File”, {“file_name”: a})
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 709, in get_doc
doc = frappe.model.document.get_doc(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 68, in get_doc
return controller(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 99, in init
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 339, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 325, in msgprint
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 298, in _raise_exception
raise raise_exception(msg)
DoesNotExistError: File {u’file_name’: u’4a7e2b26ff’} not found

The file is viewable from within the file manager, however:

This has been driving us crazy and we can’t seem to find the reason why it’s doing this. If we browse to the file URL it opens the file just fine.

Here’s the version we’re running: v12.x.x-develop () (develop)

Any suggestions?