zerodha / frappe-attachments-s3

A frappe app to upload file attachments in doctypes to s3.
Other
119 stars 136 forks source link

Having issues when emailing an attachment within ERPNext #6

Open jvfiel opened 6 years ago

jvfiel commented 6 years ago
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/boto3/s3/inject.py", line 110, in upload_file
    extra_args=ExtraArgs, callback=Callback)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/boto3/s3/transfer.py", line 275, in upload_file
    future.result()
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/s3transfer/futures.py", line 73, in result
    return self._coordinator.result()
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/s3transfer/futures.py", line 233, in result
    raise self._exception
OSError: [Errno 2] No such file or directory: './site1.local/api/method/frappe_s3_attachment.controller.generate_file?key=private/2018/04/03/Lead/some_pic.PNG'
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/boto3/s3/inject.py", line 110, in upload_file
    extra_args=ExtraArgs, callback=Callback)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/boto3/s3/transfer.py", line 275, in upload_file
    future.result()
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/s3transfer/futures.py", line 73, in result
    return self._coordinator.result()
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/s3transfer/futures.py", line 233, in result
    raise self._exception
OSError: [Errno 2] No such file or directory: './site1.local/api/method/frappe_s3_attachment.controller.generate_file?key=private/2018/04/03/Lead/some_pic.PNG'
shridarpatil commented 6 years ago

@jvfiel can you tell us how you are sending an attachment?

jvfiel commented 6 years ago

@shridarpatil via ERPNext compose mail

shridarpatil commented 6 years ago

@jvfiel can you send a screenshot?

ccfiel commented 5 years ago

Hello @shridarpatil I made a screen record. ezgif-5-daf5c5314ed2

Hope that helps

Cheers, Chris

shridarpatil commented 5 years ago

@ccfiel can you send us traceback it will help us to debug

ccfiel commented 5 years ago

@shridarpatil this is the traceback


  File "/home/frappe/tailerp02/apps/frappe/frappe/app.py", line 62, in application
    response = frappe.handler.handle()
  File "/home/frappe/tailerp02/apps/frappe/frappe/handler.py", line 22, in handle
    data = execute_cmd(cmd)
  File "/home/frappe/tailerp02/apps/frappe/frappe/handler.py", line 53, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/frappe/tailerp02/apps/frappe/frappe/__init__.py", line 939, in call
    return fn(*args, **newargs)
  File "/home/frappe/tailerp02/apps/frappe/frappe/core/doctype/communication/email.py", line 86, in make
    add_attachments(comm.name, attachments)
  File "/home/frappe/tailerp02/apps/frappe/frappe/core/doctype/communication/email.py", line 410, in add_attachments
    "Home/Attachments", attach.is_private)
  File "/home/frappe/tailerp02/apps/frappe/frappe/utils/file_manager.py", line 102, in save_url
    f.insert();
  File "/home/frappe/tailerp02/apps/frappe/frappe/model/document.py", line 242, in insert
    self.run_method("after_insert")
  File "/home/frappe/tailerp02/apps/frappe/frappe/model/document.py", line 757, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/frappe/tailerp02/apps/frappe/frappe/model/document.py", line 1026, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/frappe/tailerp02/apps/frappe/frappe/model/document.py", line 1011, in runner
    add_to_return_value(self, f(self, method, *args, **kwargs))
  File "/home/frappe/tailerp02/apps/frappe_s3_attachment/frappe_s3_attachment/controller.py", line 188, in file_upload_to_s3
    file_path, doc.file_name, doc.is_private, parent_doctype, parent_name
  File "/home/frappe/tailerp02/apps/frappe_s3_attachment/frappe_s3_attachment/controller.py", line 90, in upload_files_to_s3_with_key
    mime_type = magic.from_file(file_path, mime=True)
  File "/home/frappe/tailerp02/env/local/lib/python2.7/site-packages/magic.py", line 136, in from_file
    return m.from_file(filename)
  File "/home/frappe/tailerp02/env/local/lib/python2.7/site-packages/magic.py", line 86, in from_file
    with open(filename):
IOError: [Errno 2] No such file or directory: u'./wela.tailerp.com/api/method/frappe_s3_attachment.controller.generate_file?key=wela/2018/11/09/Salary Slip/CZDPK3IZ_pc2f0e9b'  ```
ccfiel commented 5 years ago

Hello @shridarpatil any idea what cause this? :)

sameer55chauhan commented 1 year ago

Facing the same issue, any update on the same??