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

while migrating existing files #58

Open
arvindkumar134 opened this issue Aug 18, 2023 · 1 comment
Open

while migrating existing files #58

arvindkumar134 opened this issue Aug 18, 2023 · 1 comment

Comments

@arvindkumar134
Copy link

App Versions

{
	"communications": "0.0.1",
	"erpnext": "14.33.0",
	"ezygst": "0.0.1",
	"frappe": "14.40.1",
	"frappe_s3_attachment": "0.0.1",
	"hrms": "14.10.1",
	"india_compliance": "0.0.1",
	"m_pr": "0.0.1",
	"payments": "0.0.1",
	"reconciler": "0.0.1"
}

Route

Form/S3 File Attachment/S3 File Attachment

Traceback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 66, in application
    response = frappe.api.handle()
               ^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/api.py", line 54, in handle
    return frappe.handler.handle()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/handler.py", line 47, in handle
    data = execute_cmd(cmd)
           ^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/__init__.py", line 1608, in call
    return fn(*args, **newargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe_s3_attachment/frappe_s3_attachment/controller.py", line 322, in migrate_existing_files
    upload_existing_files_s3(file['name'], file['file_name'])
  File "apps/frappe_s3_attachment/frappe_s3_attachment/controller.py", line 275, in upload_existing_files_s3
    key = s3_upload.upload_files_to_s3_with_key(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe_s3_attachment/frappe_s3_attachment/controller.py", line 110, in upload_files_to_s3_with_key
    mime_type = magic.from_file(file_path, mime=True)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "env/lib/python3.11/site-packages/magic.py", line 153, in from_file
    return m.from_file(filename)
           ^^^^^^^^^^^^^^^^^^^^^
  File "env/lib/python3.11/site-packages/magic.py", line 95, in from_file
    with open(filename):
         ^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: './Frappe/private/files/HJFSZG76_Arvindtrail.txt'

Request Data

{
	"type": "POST",
	"args": {},
	"headers": {},
	"error_handlers": {},
	"url": "/api/method/frappe_s3_attachment.controller.migrate_existing_files"
}

Response Data

{
	"exception": "FileNotFoundError: [Errno 2] No such file or directory: './Frappe/private/files/HJFSZG76_Arvindtrail.txt'"
}
@arvindkumar134
Copy link
Author

how to ignore duplicates

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

1 participant