You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 60, in application
response = frappe.api.handle()
File "/home/frappe/frappe-bench/apps/frappe/frappe/api.py", line 55, in handle
return frappe.handler.handle()
File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 22, in handle
data = execute_cmd(cmd)
File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 61, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1042, in call
return fn(*args, **newargs)
File "/home/frappe/frappe-bench/apps/frappe_s3_attachment/frappe_s3_attachment/controller.py", line 294, in migrate_existing_files
upload_existing_files_s3(file['name'], file['file_name'])
File "/home/frappe/frappe-bench/apps/frappe_s3_attachment/frappe_s3_attachment/controller.py", line 250, in upload_existing_files_s3
parent_name
File "/home/frappe/frappe-bench/apps/frappe_s3_attachment/frappe_s3_attachment/controller.py", line 98, in upload_files_to_s3_with_key
key = self.key_generator(file_name, parent_doctype, parent_name)
File "/home/frappe/frappe-bench/apps/frappe_s3_attachment/frappe_s3_attachment/controller.py", line 80, in key_generator
"/" + day + "/" + parent_doctype + "/" + key + "_" + \
TypeError: must be str, not NoneType
The text was updated successfully, but these errors were encountered:
I'm on version 12.
But I think I figured out what was wrong. It was missing some check in the key_generator function regarding the docType.
That is said I simplified this function as I just wanted my files to be uploaded at the root of my bucket so I ended up with this :
def key_generator(self, file_name, parent_doctype, parent_name):
"""
Generate keys for s3 objects uploaded with file name attached.
"""
file_name = file_name.replace(' ', '_')
file_name = self.strip_special_chars(file_name)
key = ''.join(
random.choice(
string.ascii_uppercase + string.digits) for _ in range(8)
)
final_key = key + "_" + file_name
return final_key
Expected behaviour
Import all existing attachments to S3
Actual behaviour
Error message
Step to reproduce
Click "Migrating existing files" button
Version
Latest
Traceback (most recent call last):
The text was updated successfully, but these errors were encountered: