The knowledge base URL cannot be accessed after being connected for a period of time #14268

Closed
opened 2026-02-21 19:16:26 -05:00 by yindo · 3 comments
Owner

Originally created by @tianshiqingge on GitHub (May 28, 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

1.4.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

The documents converted by Mineru are stored in the knowledge base, and the uploaded files and pictures in the documents are stored in minio. The pictures in the documents generate a URL connection address, which can only be accessed for less than 5 minutes, and then cannot be accessed. What's the problem?

Image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @tianshiqingge on GitHub (May 28, 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 1.4.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce The documents converted by Mineru are stored in the knowledge base, and the uploaded files and pictures in the documents are stored in minio. The pictures in the documents generate a URL connection address, which can only be accessed for less than 5 minutes, and then cannot be accessed. What's the problem? ![Image](https://github.com/user-attachments/assets/d1398f4d-af4d-4bba-8772-f1cc1cff0144) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 19:16:26 -05:00
yindo closed this issue 2026-02-21 19:16:26 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (May 28, 2025):

The issue you’re experiencing is due to how Dify handles file URLs: image and file URLs are signed and set to expire after 5 minutes by default. This is controlled by the FILES_ACCESS_TIMEOUT environment variable in your Dify configuration, which is set to 300 seconds (5 minutes) out of the box. After this period, the signature expires and the URL becomes inaccessible, resulting in errors like 403 Forbidden or 404 Not Found if you try to access the link after it expires [source].

To resolve this, you can increase the value of FILES_ACCESS_TIMEOUT in your environment configuration (for example, in your .env or Docker Compose environment settings) to a longer duration that fits your needs. After changing this value, restart your Dify services for the new setting to take effect.

If you want the URLs to remain accessible for a longer period, set FILES_ACCESS_TIMEOUT to a higher value (in seconds). For example, setting it to 3600 will make the URLs valid for 1 hour.

You can find more details about this setting and its default value in the Dify documentation and configuration files [source].

There are no open or closed issues in the Dify repository that specifically address this problem for version 1.4.0, so adjusting the timeout should resolve your issue.

To reply, just mention my name @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (May 28, 2025): <!-- Answer --> The issue you’re experiencing is due to how Dify handles file URLs: image and file URLs are signed and set to expire after 5 minutes by default. This is controlled by the `FILES_ACCESS_TIMEOUT` environment variable in your Dify configuration, which is set to 300 seconds (5 minutes) out of the box. After this period, the signature expires and the URL becomes inaccessible, resulting in errors like 403 Forbidden or 404 Not Found if you try to access the link after it expires [[source](https://github.com/langgenius/dify/blob/main/api/.env.example)]. To resolve this, you can increase the value of `FILES_ACCESS_TIMEOUT` in your environment configuration (for example, in your `.env` or Docker Compose environment settings) to a longer duration that fits your needs. After changing this value, restart your Dify services for the new setting to take effect. If you want the URLs to remain accessible for a longer period, set `FILES_ACCESS_TIMEOUT` to a higher value (in seconds). For example, setting it to `3600` will make the URLs valid for 1 hour. You can find more details about this setting and its default value in the Dify documentation and configuration files [[source](https://github.com/langgenius/dify/blob/main/docker/.env.example)]. There are no open or closed issues in the Dify repository that specifically address this problem for version 1.4.0, so adjusting the timeout should resolve your issue. <!-- Dosu Comment Footer --> *To reply, just mention my name [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/5ed7e3af-0454-4e04-b387-4bca3e69b780?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/5ed7e3af-0454-4e04-b387-4bca3e69b780?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/5ed7e3af-0454-4e04-b387-4bca3e69b780?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/5ed7e3af-0454-4e04-b387-4bca3e69b780?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/5ed7e3af-0454-4e04-b387-4bca3e69b780?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/5ed7e3af-0454-4e04-b387-4bca3e69b780?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/5ed7e3af-0454-4e04-b387-4bca3e69b780?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/20378)
Author
Owner

@tianshiqingge commented on GitHub (May 28, 2025):

@dosu
What if I don't want to set an expiration date? How should I configure it? Does FILES_ACCESS_TIMEOUT not configure any value?

@tianshiqingge commented on GitHub (May 28, 2025): @dosu What if I don't want to set an expiration date? How should I configure it? Does FILES_ACCESS_TIMEOUT not configure any value?
Author
Owner

@dosubot[bot] commented on GitHub (May 28, 2025):

Currently, Dify does not document or support a way to completely disable the expiration of file URLs by leaving FILES_ACCESS_TIMEOUT unset or setting it to a special value like 0 or null. The code checks whether the current time minus the timestamp is less than or equal to FILES_ACCESS_TIMEOUT, and the default is 300 seconds (5 minutes) [source].

If you want URLs to last longer, you can set FILES_ACCESS_TIMEOUT to a very large number (for example, several years in seconds), but there is no indication in the code or documentation that setting it to 0, null, or leaving it unset will disable expiration entirely. Setting an extremely high value will effectively make the URLs "never expire" for practical purposes, but be aware this could have security implications.

If you need truly permanent URLs, you may need to modify the code to bypass the timeout check, as there is no built-in option for unlimited validity.

To reply, just mention my name @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (May 28, 2025): <!-- Answer --> Currently, Dify does not document or support a way to completely disable the expiration of file URLs by leaving FILES_ACCESS_TIMEOUT unset or setting it to a special value like 0 or null. The code checks whether the current time minus the timestamp is less than or equal to FILES_ACCESS_TIMEOUT, and the default is 300 seconds (5 minutes) [[source](https://github.com/langgenius/dify/blob/main/api/configs/feature/__init__.py)]. If you want URLs to last longer, you can set FILES_ACCESS_TIMEOUT to a very large number (for example, several years in seconds), but there is no indication in the code or documentation that setting it to 0, null, or leaving it unset will disable expiration entirely. Setting an extremely high value will effectively make the URLs "never expire" for practical purposes, but be aware this could have security implications. If you need truly permanent URLs, you may need to modify the code to bypass the timeout check, as there is no built-in option for unlimited validity. <!-- Dosu Comment Footer --> *To reply, just mention my name [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/d8fd0f32-f345-459f-a3ea-3a305a1b7c3e?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/d8fd0f32-f345-459f-a3ea-3a305a1b7c3e?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/d8fd0f32-f345-459f-a3ea-3a305a1b7c3e?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/d8fd0f32-f345-459f-a3ea-3a305a1b7c3e?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/d8fd0f32-f345-459f-a3ea-3a305a1b7c3e?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/d8fd0f32-f345-459f-a3ea-3a305a1b7c3e?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/d8fd0f32-f345-459f-a3ea-3a305a1b7c3e?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/20378)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#14268