When testing the custom tool, the historical url was used #7133

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

Originally created by @einherjar9527 on GitHub (Dec 10, 2024).

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.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  • Dify deploy in k8s
  • Custom tools is k8s svc
  • k8s dns is correct, other tools don't have this problem
  • The before configured url is Intranet ip address
  • The after configured url is k8s svc name
  • Unsaved custom tools Click Test
    image

✔️ Expected Behavior

Normal call custom tools

Actual Behavior

image
Reached maximum retries (3) for URL http://172.22.65.34:8008/api/echo
image

Originally created by @einherjar9527 on GitHub (Dec 10, 2024). ### 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 0.11.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce - Dify deploy in k8s - Custom tools is k8s svc - k8s dns is correct, other tools don't have this problem - The before configured url is **Intranet ip address** - The after configured url is **k8s svc name** - Unsaved custom tools Click Test ![image](https://github.com/user-attachments/assets/e72d15b8-d1ed-4501-a16e-96999a342551) ### ✔️ Expected Behavior Normal call custom tools ### ❌ Actual Behavior ![image](https://github.com/user-attachments/assets/e72d15b8-d1ed-4501-a16e-96999a342551) Reached maximum retries (3) for URL http://172.22.65.34:8008/api/echo ![image](https://github.com/user-attachments/assets/5e0c3aa5-b535-41dc-ba3c-2a97542b87f5)
yindo added the 🔨 feat:tools label 2026-02-21 18:19:04 -05:00
yindo closed this issue 2026-02-21 18:19:04 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 10, 2024):

The issue you're experiencing seems to be related to Dify using an outdated URL when testing custom tools. This could be due to caching or persistence of the URL configuration that hasn't been updated to reflect the new Kubernetes service name.

Here are a few steps you can take to troubleshoot and potentially resolve this issue:

  1. Check Configuration Persistence: Ensure that the new URL configuration (using the Kubernetes service name) is saved correctly in the Dify configuration files or database. Sometimes, changes might not be saved due to UI or backend issues.

  2. Clear Cache: If Dify caches URL configurations, try clearing the cache to force it to use the updated URL. This might involve restarting the Dify service or clearing any application-level caches.

  3. Verify DNS Resolution: Since other tools are resolving the Kubernetes service name correctly, double-check that Dify is configured to use the same DNS settings. This ensures that it can resolve the service name to the correct IP address.

  4. Review Retry Mechanism: The error message indicates that the request reached the maximum number of retries. You might want to review the retry mechanism and configurations in Dify to ensure they are set appropriately for your environment [1].

  5. Logs and Debugging: Check the logs for any errors or warnings that might provide more insight into why the old URL is being used. This can help identify if there's a specific part of the code or configuration that's not updating correctly.

If these steps don't resolve the issue, you might need to delve deeper into the Dify codebase or configuration to identify where the URL is being stored and how it can be updated.

To continue talking to Dosu, mention @dosu.


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

@dosubot[bot] commented on GitHub (Dec 10, 2024): <!-- Answer --> The issue you're experiencing seems to be related to Dify using an outdated URL when testing custom tools. This could be due to caching or persistence of the URL configuration that hasn't been updated to reflect the new Kubernetes service name. Here are a few steps you can take to troubleshoot and potentially resolve this issue: 1. **Check Configuration Persistence**: Ensure that the new URL configuration (using the Kubernetes service name) is saved correctly in the Dify configuration files or database. Sometimes, changes might not be saved due to UI or backend issues. 2. **Clear Cache**: If Dify caches URL configurations, try clearing the cache to force it to use the updated URL. This might involve restarting the Dify service or clearing any application-level caches. 3. **Verify DNS Resolution**: Since other tools are resolving the Kubernetes service name correctly, double-check that Dify is configured to use the same DNS settings. This ensures that it can resolve the service name to the correct IP address. 4. **Review Retry Mechanism**: The error message indicates that the request reached the maximum number of retries. You might want to review the retry mechanism and configurations in Dify to ensure they are set appropriately for your environment <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/helper/ssrf_proxy.py)</sup>. 5. **Logs and Debugging**: Check the logs for any errors or warnings that might provide more insight into why the old URL is being used. This can help identify if there's a specific part of the code or configuration that's not updating correctly. If these steps don't resolve the issue, you might need to delve deeper into the Dify codebase or configuration to identify where the URL is being stored and how it can be updated. <!-- 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/944219b9-3eb2-43cc-b75d-725bac4771fd?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/944219b9-3eb2-43cc-b75d-725bac4771fd?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/944219b9-3eb2-43cc-b75d-725bac4771fd?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/944219b9-3eb2-43cc-b75d-725bac4771fd?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/944219b9-3eb2-43cc-b75d-725bac4771fd?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/944219b9-3eb2-43cc-b75d-725bac4771fd?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#7133