Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having issues when emailing an attachment within ERPNext #6

Open
jvfiel opened this issue Apr 3, 2018 · 8 comments
Open

Having issues when emailing an attachment within ERPNext #6

jvfiel opened this issue Apr 3, 2018 · 8 comments

Comments

@jvfiel
Copy link

jvfiel commented Apr 3, 2018

  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
Copy link
Member

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

@jvfiel
Copy link
Author

jvfiel commented May 1, 2018

@shridarpatil via ERPNext compose mail

@shridarpatil
Copy link
Member

@jvfiel can you send a screenshot?

@ccfiel
Copy link

ccfiel commented Nov 9, 2018

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

Hope that helps

Cheers,
Chris

@shridarpatil
Copy link
Member

shridarpatil commented Nov 9, 2018

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

@ccfiel
Copy link

ccfiel commented Nov 9, 2018

@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
Copy link

ccfiel commented Nov 11, 2018

Hello @shridarpatil any idea what cause this? :)

@sameer55chauhan
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants