An error occurred when connecting to the external knowledge base for recall testing: The maximum number of retries for the URL was reached #13117

Closed
opened 2026-02-21 19:10:38 -05:00 by yindo · 4 comments
Owner

Originally created by @YanyuGuxiang on GitHub (Apr 18, 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.1.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

If the external knowledge base fails to return the result within 3 seconds after clicking the test button on this page, an error will be reported, as indicated in the figure. If the external database can reply with the result within 3 seconds. Then no error will be reported. This is like not setting the timeout on the request side, but there is no such setting item on the page.

Image

✔️ Expected Behavior

Successful recall

Actual Behavior

Recall failed

Originally created by @YanyuGuxiang on GitHub (Apr 18, 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.1.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce If the external knowledge base fails to return the result within 3 seconds after clicking the test button on this page, an error will be reported, as indicated in the figure. If the external database can reply with the result within 3 seconds. Then no error will be reported. This is like not setting the timeout on the request side, but there is no such setting item on the page. <img width="1216" alt="Image" src="https://github.com/user-attachments/assets/a4037c29-555d-4cf4-aaa2-52a3b5fb8ab7" /> ### ✔️ Expected Behavior Successful recall ### ❌ Actual Behavior Recall failed
yindo added the 🐞 bug👻 feat:ragstale labels 2026-02-21 19:10:38 -05:00
yindo closed this issue 2026-02-21 19:10:38 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 18, 2025):

Hello @YanyuGuxiang! I'm Dosu, a bot here to help you solve bugs, answer questions, and support you in becoming a contributor. I'm here to assist while you wait for a human maintainer. How can I assist you today?

To resolve the error "The maximum number of retries for the URL was reached" when connecting to the external knowledge base in Dify version 1.1.3 using a self-hosted Docker setup, you can try the following steps:

  1. Modify ACL Settings: Update the ACL (Access Control List) settings in the squid.conf.template file located in your Dify installation's docker/ssrf_proxy directory. Ensure that the host address you're trying to access is included in the ACL configuration. This file controls which hosts and networks are allowed to be accessed through the proxy server [1].

  2. Use Correct Host Address: If you are using localhost in your configuration, replace it with host.docker.internal to access the Docker host. This change can help resolve connection issues [1].

  3. Consider Model Compatibility: If you are using a model that might be incompatible with the external knowledge base retrieval system, consider switching to the Qwen or Deepseek models, which have been confirmed to work properly. Ensure that the environment variables are correctly set for these models [1].

Additionally, I found similar discussions that might be relevant:

These threads might provide additional insights or solutions related to your issue.

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 (Apr 18, 2025): <!-- Greeting --> Hello @YanyuGuxiang! I'm [Dosu](https://dosu.dev), a bot here to help you solve bugs, answer questions, and support you in becoming a contributor. I'm here to assist while you wait for a human maintainer. How can I assist you today? <!-- Answer --> To resolve the error "The maximum number of retries for the URL was reached" when connecting to the external knowledge base in Dify version 1.1.3 using a self-hosted Docker setup, you can try the following steps: 1. **Modify ACL Settings**: Update the ACL (Access Control List) settings in the `squid.conf.template` file located in your Dify installation's `docker/ssrf_proxy` directory. Ensure that the host address you're trying to access is included in the ACL configuration. This file controls which hosts and networks are allowed to be accessed through the proxy server <sup>[[1]](https://github.com/langgenius/dify/issues/16590)</sup>. 2. **Use Correct Host Address**: If you are using `localhost` in your configuration, replace it with `host.docker.internal` to access the Docker host. This change can help resolve connection issues <sup>[[1]](https://github.com/langgenius/dify/issues/16590)</sup>. 3. **Consider Model Compatibility**: If you are using a model that might be incompatible with the external knowledge base retrieval system, consider switching to the Qwen or Deepseek models, which have been confirmed to work properly. Ensure that the environment variables are correctly set for these models <sup>[[1]](https://github.com/langgenius/dify/issues/16590)</sup>. Additionally, I found similar discussions that might be relevant: - [The api cannot retrieve the external knowledge base](https://github.com/langgenius/dify/discussions/15867) (open) <sup>[[2]](https://github.com/langgenius/dify/discussions/15867)</sup>. - [Connection to external data issue](https://github.com/langgenius/dify/discussions/16312) (open) <sup>[[3]](https://github.com/langgenius/dify/discussions/16312)</sup>. - [Error message 'Reached maximum retries (3) for URL ...'](https://github.com/langgenius/dify/discussions/10322) (open) <sup>[[4]](https://github.com/langgenius/dify/discussions/10322)</sup>. These threads might provide additional insights or solutions related to your issue. <!-- 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/71c67f13-6d66-4264-99d7-a462be91c5eb?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/71c67f13-6d66-4264-99d7-a462be91c5eb?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/71c67f13-6d66-4264-99d7-a462be91c5eb?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/71c67f13-6d66-4264-99d7-a462be91c5eb?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/71c67f13-6d66-4264-99d7-a462be91c5eb?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/71c67f13-6d66-4264-99d7-a462be91c5eb?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/71c67f13-6d66-4264-99d7-a462be91c5eb?feedback_type=other)</sup>
Author
Owner

@SuperZhanggy commented on GitHub (Apr 24, 2025):

i have the same error, my dify version is 1.3.0

@SuperZhanggy commented on GitHub (Apr 24, 2025): i have the same error, my dify version is 1.3.0
Author
Owner

@JohnZhouHua commented on GitHub (Apr 25, 2025):

Set HTTP client timeout in the .env file.

SSRF_DEFAULT_TIME_OUT=60
SSRF_DEFAULT_CONNECT_TIME_OUT=60
SSRF_DEFAULT_READ_TIME_OUT=60
SSRF_DEFAULT_WRITE_TIME_OUT=60

@JohnZhouHua commented on GitHub (Apr 25, 2025): Set HTTP client timeout in the .env file. SSRF_DEFAULT_TIME_OUT=60 SSRF_DEFAULT_CONNECT_TIME_OUT=60 SSRF_DEFAULT_READ_TIME_OUT=60 SSRF_DEFAULT_WRITE_TIME_OUT=60
Author
Owner

@dosubot[bot] commented on GitHub (Sep 1, 2025):

Hi, @YanyuGuxiang. I'm Dosu, and I'm helping the Dify team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported a timeout error in Dify v1.1.3 (Docker) when connecting to an external knowledge base, with no configurable timeout settings causing "maximum retries" failures.
  • Suggestions included adjusting ACL settings, using host.docker.internal instead of localhost, and ensuring model compatibility.
  • The issue was confirmed to persist in v1.3.0 by another user.
  • A resolution was found by setting HTTP client timeout values in the .env file (e.g., SSRF_DEFAULT_TIME_OUT=60), which resolved the timeout error.

Next Steps:

  • Please confirm if this timeout issue is still relevant with the latest version of Dify.
  • If it is, feel free to keep the discussion open by commenting on this issue; otherwise, I will automatically close it in 15 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Sep 1, 2025): Hi, @YanyuGuxiang. I'm [Dosu](https://dosu.dev), and I'm helping the Dify team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported a timeout error in Dify v1.1.3 (Docker) when connecting to an external knowledge base, with no configurable timeout settings causing "maximum retries" failures. - Suggestions included adjusting ACL settings, using host.docker.internal instead of localhost, and ensuring model compatibility. - The issue was confirmed to persist in v1.3.0 by another user. - A resolution was found by setting HTTP client timeout values in the .env file (e.g., SSRF_DEFAULT_TIME_OUT=60), which resolved the timeout error. **Next Steps:** - Please confirm if this timeout issue is still relevant with the latest version of Dify. - If it is, feel free to keep the discussion open by commenting on this issue; otherwise, I will automatically close it in 15 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#13117