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

Failed to upload image when creating course #1053

Open
Meikelrizkyhartawan opened this issue Oct 10, 2024 · 3 comments
Open

Failed to upload image when creating course #1053

Meikelrizkyhartawan opened this issue Oct 10, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@Meikelrizkyhartawan
Copy link

After trying to move the service of Frappe LMS from docker into kubernetes im facing error issue while uploading image when creating Course

image

Endpoint : http://192.168.107.166:8000/api/method/upload_file
Payload :

------WebKitFormBoundaryQDPh1aAxyKTWNAPG
Content-Disposition: form-data; name="file"; filename="frame_1727483342_2814.png"
Content-Type: image/png


------WebKitFormBoundaryQDPh1aAxyKTWNAPG
Content-Disposition: form-data; name="is_private"

1
------WebKitFormBoundaryQDPh1aAxyKTWNAPG
Content-Disposition: form-data; name="folder"

Home/Attachments
------WebKitFormBoundaryQDPh1aAxyKTWNAPG
Content-Disposition: form-data; name="optimize"

true
------WebKitFormBoundaryQDPh1aAxyKTWNAPG--

Error Response =

{
    "exception": "frappe.exceptions.LinkValidationError: Could not find Folder: Home/Attachments",
    "exc_type": "LinkValidationError",
    "exc": "[\"Traceback (most recent call last):\\n  File \\\"apps/frappe/frappe/app.py\\\", line 110, in application\\n    response = frappe.api.handle(request)\\n               ^^^^^^^^^^^^^^^^^^^^^^^^^^\\n  File \\\"apps/frappe/frappe/api/__init__.py\\\", line 49, in handle\\n    data = endpoint(**arguments)\\n           ^^^^^^^^^^^^^^^^^^^^^\\n  File \\\"apps/frappe/frappe/api/v1.py\\\", line 36, in handle_rpc_call\\n    return frappe.handler.handle()\\n           ^^^^^^^^^^^^^^^^^^^^^^^\\n  File \\\"apps/frappe/frappe/handler.py\\\", line 49, in handle\\n    data = execute_cmd(cmd)\\n           ^^^^^^^^^^^^^^^^\\n  File \\\"apps/frappe/frappe/handler.py\\\", line 85, in execute_cmd\\n    return frappe.call(method, **frappe.form_dict)\\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n  File \\\"apps/frappe/frappe/__init__.py\\\", line 1682, in call\\n    return fn(*args, **newargs)\\n           ^^^^^^^^^^^^^^^^^^^^\\n  File \\\"apps/frappe/frappe/utils/typing_validations.py\\\", line 31, in wrapper\\n    return func(*args, **kwargs)\\n           ^^^^^^^^^^^^^^^^^^^^^\\n  File \\\"apps/frappe/frappe/handler.py\\\", line 245, in upload_file\\n    ).save(ignore_permissions=ignore_permissions)\\n      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n  File \\\"apps/frappe/frappe/model/document.py\\\", line 334, in save\\n    return self._save(*args, **kwargs)\\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n  File \\\"apps/frappe/frappe/model/document.py\\\", line 356, in _save\\n    return self.insert()\\n           ^^^^^^^^^^^^^\\n  File \\\"apps/frappe/frappe/model/document.py\\\", line 278, in insert\\n    self._validate_links()\\n  File \\\"apps/frappe/frappe/model/document.py\\\", line 918, in _validate_links\\n    frappe.throw(_(\\\"Could not find {0}\\\").format(msg), frappe.LinkValidationError)\\n  File \\\"apps/frappe/frappe/__init__.py\\\", line 570, in throw\\n    msgprint(\\n  File \\\"apps/frappe/frappe/__init__.py\\\", line 542, in msgprint\\n    _raise_exception()\\n  File \\\"apps/frappe/frappe/__init__.py\\\", line 496, in _raise_exception\\n    raise exc\\nfrappe.exceptions.LinkValidationError: Could not find Folder: Home/Attachments\\n\"]",
    "_server_messages": "[\"{\\\"message\\\": \\\"Could not find Folder: Home/Attachments\\\", \\\"title\\\": \\\"Message\\\", \\\"indicator\\\": \\\"red\\\", \\\"raise_exception\\\": 1, \\\"__frappe_exc_id\\\": \\\"0f09a7cdd407d168f4e52f05914a1d570e1ee8cf6b25fdafff5c322d\\\"}\"]"
}
@Meikelrizkyhartawan Meikelrizkyhartawan added the bug Something isn't working label Oct 10, 2024
@pateljannat
Copy link
Collaborator

@Meikelrizkyhartawan did you by chance delete the Home/Attachments folder?

@Meikelrizkyhartawan
Copy link
Author

@pateljannat Could you please tell me the exact location of the Home/Attachments path? , because im sure im not delete it , because the image that i already insert before is still exist.

this is my recent folder structure of frappe lms
image

@pateljannat
Copy link
Collaborator

@Meikelrizkyhartawan It exists in the File doctype. Check the list view there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants