dify icon indicating copy to clipboard operation
dify copied to clipboard

some node can't get correct url of a file

Open hjlarry opened this issue 1 year ago • 6 comments

Self Checks

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

Dify version

0.10.0

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

  1. add a start node, list operator node, and an end node.
  2. upload any local file in the start node, in the end node get list operator node's url

✔️ Expected Behavior

get the correct file url

❌ Actual Behavior

not get the correct value

image

hjlarry avatar Oct 21 '24 12:10 hjlarry

I found some relevant information that might help with the issue you're experiencing regarding file URLs in a self-hosted Dify setup.

  1. Similar Issues: There is a similar open issue titled "seems that some variables are lost after the Parameter Extraction node" [1]. This issue was referenced by other issues related to input variables not being updated correctly [2].

  2. Potential Causes: The list operator node might return a null value if no array elements meet the specified filter conditions. This could happen if the filter conditions are too restrictive or if the input array does not contain any elements that match the criteria [3].

  3. Configuration Issues: In a self-hosted environment, incorrect FILES_URL configuration or storage configuration issues could lead to problems with file URL retrieval. Ensure that FILES_URL is configured as an externally accessible address and that the storage directory is properly mounted [4].

  4. Error Handling: There are error handling mechanisms in place for file URL generation. For example, in the RemoteFileInfoApi class, exceptions are caught and returned as a JSON response with a 400 status code, which can help identify issues during URL processing [5].

  5. Logging: There is logging available in the codebase that could help identify issues with file URL generation. For instance, errors in downloading files from a URL are logged in the ToolFileManager class [6].

You might want to check these configurations and logs to diagnose the issue further.

To continue talking to Dosu, mention @dosu.

dosubot[bot] avatar Oct 21 '24 12:10 dosubot[bot]

the remote_url and the url attr of File is not so much clear

I think the remote_url attr is necessary, for example, I use a tool generate an image, use another tool edit or vectorize the image. directly transfer the first tool response url to the second tool is more efficient

hjlarry avatar Oct 21 '24 12:10 hjlarry

same here

1linedata avatar Oct 22 '24 04:10 1linedata

same as #9681 #9681

nne998 avatar Oct 23 '24 02:10 nne998

The problem still exists at present.

gms5144 avatar Oct 25 '24 06:10 gms5144

Are there any workarounds?

tsugitta avatar Oct 26 '24 10:10 tsugitta

10.2没有解决这个问题

xs818818 avatar Oct 29 '24 06:10 xs818818

is this problem fixed in 0.11.0?

Yifan-Chang-Jerry avatar Nov 06 '24 04:11 Yifan-Chang-Jerry

I need to provide an explanation regarding this issue: currently, File.url refers to the remote_url attribute shown in the logs. The url in the logs is a signed, short-lived temporary address, and it currently cannot be referenced within the Workflow.

laipz8200 avatar Nov 06 '24 04:11 laipz8200

not fixed yet 😔

AnoyiX avatar Nov 13 '24 01:11 AnoyiX

Now, the question is how we should handle these URLs that will expire soon. They might appear in the current chat, show up in logs, and users could even notice that these addresses quickly become inaccessible within the same conversation (if the chat lasts long enough).

I don’t think opening temporary signed URLs is a very elegant solution. We need to find a more practical way to allow users to access the files.

laipz8200 avatar Nov 14 '24 07:11 laipz8200