agritheory/cloud_storage

Error while sending emails with attachments

Alchez opened this issue · 0 comments

Traceback:

If you test sending emails with an attachment, you get the following error:

FileNotFoundError: [Errno 2] No such file or directory: '/api/method/retrieve?key=attachments-new/Task/20230410 PO Report/xzCckWS.png'
  File "frappe/utils/background_jobs.py", line 160, in execute_job
    method(**kwargs)
  File "frappe/email/doctype/email_queue/email_queue.py", line 183, in send_mail
    record.send(is_background_task=is_background_task, smtp_server_instance=smtp_server_instance)
  File "frappe/email/doctype/email_queue/email_queue.py", line 134, in send
    message = ctx.build_message(recipient.recipient)
  File "frappe/email/doctype/email_queue/email_queue.py", line 293, in build_message
    message = self.include_attachments(message)
  File "frappe/email/doctype/email_queue/email_queue.py", line 348, in include_attachments
    fcontent = _file.get_content()
  File "frappe/core/doctype/file/file.py", line 441, in get_content
    with open(file_path, mode="rb") as f:

Context:

Initially, attachments can be viewed normally by clicking on their links in the top-left Attachments section.

After trying to send one of them via email, clicking on the attachment link again generates this error:

image