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: The url output by the list_operator is null #10590

Closed
5 tasks done
sunxiaojia123 opened this issue Nov 12, 2024 · 3 comments · May be fixed by #10591 or #10513
Closed
5 tasks done

fix: The url output by the list_operator is null #10590

sunxiaojia123 opened this issue Nov 12, 2024 · 3 comments · May be fixed by #10591 or #10513
Labels
🐞 bug Something isn't working

Comments

@sunxiaojia123
Copy link

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.11.1

Cloud or Self Hosted

Cloud

Steps to reproduce

I want to use the list operation module to extract the URL of the file file, including the dify cloud and local deployment operations, and the workflow shows that it can be completed. As shown below:

image

However, on the dify cloud, the output is null, and in the local deployment, the output is path, but it does not contain parameters and cannot be used. As shown below:

image

The url can be output in the first or last data obtained by list_operator. After reference, url is not a field of File model, but a field processed by self.generate_url(). However, the code uses the direct output of remote_url, which is often an incomplete field or null, so it is more reasonable to replace it with a field generated by generate_url()

✔️ Expected Behavior

image_url,As shown below:
image

❌ Actual Behavior

"url": null

Copy link

dosubot bot commented Nov 12, 2024

I found a similar discussion regarding file URL issues in Dify, specifically about the file URL not matching the file location in S3 for a self-hosted instance. You can check it out here [1].

Regarding your issue, it seems that the list_operator module is directly using the remote_url attribute, which can be null or incomplete. Instead, it would be more appropriate to use the generate_url() function from the File model. This function generates a complete and usable URL based on the file's attributes and transfer method [2].

To resolve this, you might need to modify the code to use generate_url() instead of directly accessing remote_url. This change should ensure that the URLs are correctly generated and not null.

To continue talking to Dosu, mention @dosu.

@dosubot dosubot bot added the 🐞 bug Something isn't working label Nov 12, 2024
@XiaoLey
Copy link
Contributor

XiaoLey commented Nov 12, 2024

hi, this issue has been fixed in PR #10513. just hang tight while it gets merged. 😊

@laipz8200
Copy link
Collaborator

duplicated with #9567

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
3 participants