can't get file url #8447

Closed
opened 2026-02-21 18:25:45 -05:00 by yindo · 1 comment
Owner

Originally created by @xujipm on GitHub (Feb 20, 2025).

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

Version 0.15.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Image

✔️ Expected Behavior

return file's url or byte

Actual Behavior

return None or empty

Originally created by @xujipm on GitHub (Feb 20, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version Version 0.15.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ![Image](https://github.com/user-attachments/assets/552db9d4-1a5a-4a46-bded-e2d11a202a6e) ### ✔️ Expected Behavior return file's url or byte ### ❌ Actual Behavior return None or empty
yindo closed this issue 2026-02-21 18:25:45 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 20, 2025):

I found some similar discussions that might be relevant to your issue:

  1. Should we allow access to the signed URL in the workflow? - This discussion is still open and might provide insights into URL access issues [1].

  2. File URL as returned in dify workflow does not match the file location in s3 (self hosted instance) - This is another open discussion that could be related to your problem [2].

Regarding your issue with file URLs returning None or empty values, here are some potential causes and solutions:

  • Ensure that the FILES_URL and FILES_ACCESS_TIMEOUT are correctly configured in your environment settings. These settings are crucial for generating and accessing file URLs in a self-hosted instance [3].

  • The generate_url method might return None if the transfer_method is REMOTE_URL and the remote_url attribute is None or an empty string. Additionally, ensure that the related_id and extension are not None for LOCAL_FILE or TOOL_FILE transfer methods, as these are required for generating a valid URL [4].

  • Check the configuration of your storage type (e.g., opendal, s3) to ensure it is set up correctly, as this can affect URL generation [5].

These steps should help you troubleshoot the issue with file URL generation in your Dify setup.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Feb 20, 2025): <!-- Answer --> I found some similar discussions that might be relevant to your issue: 1. [Should we allow access to the signed URL in the workflow?](https://github.com/langgenius/dify/discussions/10687) - This discussion is still open and might provide insights into URL access issues <sup>[[1]](https://github.com/langgenius/dify/discussions/10687)</sup>. 2. [File URL as returned in dify workflow does not match the file location in s3 (self hosted instance)](https://github.com/langgenius/dify/discussions/6729) - This is another open discussion that could be related to your problem <sup>[[2]](https://github.com/langgenius/dify/discussions/6729)</sup>. Regarding your issue with file URLs returning `None` or empty values, here are some potential causes and solutions: - Ensure that the `FILES_URL` and `FILES_ACCESS_TIMEOUT` are correctly configured in your environment settings. These settings are crucial for generating and accessing file URLs in a self-hosted instance <sup>[[3]](https://github.com/langgenius/dify/blob/main/api/.env.example)</sup>. - The `generate_url` method might return `None` if the `transfer_method` is `REMOTE_URL` and the `remote_url` attribute is `None` or an empty string. Additionally, ensure that the `related_id` and `extension` are not `None` for `LOCAL_FILE` or `TOOL_FILE` transfer methods, as these are required for generating a valid URL <sup>[[4]](https://github.com/langgenius/dify/blob/main/api/core/file/models.py)</sup>. - Check the configuration of your storage type (e.g., `opendal`, `s3`) to ensure it is set up correctly, as this can affect URL generation <sup>[[5]](https://github.com/langgenius/dify/blob/main/docker/.env.example)</sup>. These steps should help you troubleshoot the issue with file URL generation in your Dify setup. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/bcb57aa4-d898-48cb-b81c-1e439938f576?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/bcb57aa4-d898-48cb-b81c-1e439938f576?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/bcb57aa4-d898-48cb-b81c-1e439938f576?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/bcb57aa4-d898-48cb-b81c-1e439938f576?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/bcb57aa4-d898-48cb-b81c-1e439938f576?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/bcb57aa4-d898-48cb-b81c-1e439938f576?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/bcb57aa4-d898-48cb-b81c-1e439938f576?feedback_type=other)</sup>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#8447