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

fix: download some remote files raise error #10781

Merged
merged 1 commit into from
Nov 19, 2024
Merged

Conversation

hjlarry
Copy link
Contributor

@hjlarry hjlarry commented Nov 17, 2024

Summary

Tip

Close issue syntax: Fixes #<issue number> or Resolves #<issue number>, see documentation for more details.

the error is:

2024-11-16 20:50:26,250.250 INFO [Thread-207 (process_request_thread)] [_client.py:1038] - HTTP Request: HEAD https://cloud.video.taobao.com/vod/S8T54f_w1rkdfLdYjL3S5zKN9CrhkzuhRwOhF313tIQ.mp4 "HTTP/1.1 302 "
2024-11-16 20:50:26,762.762 INFO [Thread-207 (process_request_thread)] [_client.py:1038] - HTTP Request: GET https://cloud.video.taobao.com/vod/S8T54f_w1rkdfLdYjL3S5zKN9CrhkzuhRwOhF313tIQ.mp4 "HTTP/1.1 302 "
2024-11-16 20:50:26,763.763 ERROR [Thread-207 (process_request_thread)] [app.py:838] - Exception on /console/api/remote-files/upload [POST]
Traceback (most recent call last):
  File "C:\Users\hejl\PycharmProjects\dify\api\.venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\hejl\PycharmProjects\dify\api\.venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\hejl\PycharmProjects\dify\api\.venv\Lib\site-packages\flask_restful\__init__.py", line 489, in wrapper
    resp = resource(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\hejl\PycharmProjects\dify\api\.venv\Lib\site-packages\flask\views.py", line 110, in view
    return current_app.ensure_sync(self.dispatch_request)(**kwargs)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\hejl\PycharmProjects\dify\api\.venv\Lib\site-packages\flask_restful\__init__.py", line 604, in dispatch_request
    resp = meth(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\hejl\PycharmProjects\dify\api\.venv\Lib\site-packages\flask_restful\__init__.py", line 696, in wrapper
    resp = f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "C:\Users\hejl\PycharmProjects\dify\api\controllers\console\remote_files.py", line 49, in post
    resp.raise_for_status()
  File "C:\Users\hejl\PycharmProjects\dify\api\.venv\Lib\site-packages\httpx\_models.py", line 763, in raise_for_status
    raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Redirect response '302 ' for url 'https://cloud.video.taobao.com/vod/S8T54f_w1rkdfLdYjL3S5zKN9CrhkzuhRwOhF313tIQ.mp4'
Redirect location: 'https://tbexpand.alicdn.com/1724398134200/80d7b62dfe82d1e7.mp4?auth_key=1731821615-0-0-c36ebaa781aa6bc3a92df19ef4fd559d&biz=publish-662febf21aa149fd&t=2166e0db17318189152538525e13aa&t=2166e0db17318189152538525e13aa&b=publish&p=cloudvideo_http_video_extranet_notrans&i=478401527148' 
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/302
2024-11-16 20:50:26,766.766 INFO [Thread-207 (process_request_thread)] [_internal.py:97] - 127.0.0.1 - - [17/Nov/2024 12:50:26] "POST /console/api/remote-files/upload HTTP/1.1" 500 -

Checklist

Important

Please review the checklist below before submitting your pull request.

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. 🐞 bug Something isn't working labels Nov 17, 2024
@bowenliang123
Copy link
Contributor

cc @Yeuoly

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 19, 2024
@laipz8200 laipz8200 merged commit 904ea05 into langgenius:main Nov 19, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants