Unable to make http request either in http node or custom tool and return [Errno -3]
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] Please do not modify this template :) and fill in all the required fields.
Dify version
0.6.8
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
When I make a request to get the data using the http node, it return error [Errno -3] Temporary failure in name resolution. this situation also exists in the defined tools. But this site is avaliable in my host using curl. (Test website: http://baidu.com)
http node:
tool:
✔️ Expected Behavior
http return correctly.
❌ Actual Behavior
No response
To address the [Errno -3] Temporary failure in name resolution error you're encountering with Dify in Docker, follow these steps to ensure proper DNS resolution for your containers:
-
Modify Docker's DNS Settings: Edit the Docker daemon configuration file (
/etc/docker/daemon.json) to specify DNS servers:{ "dns": ["8.8.8.8", "8.8.4.4"] }Restart the Docker daemon afterward.
-
Specify DNS in Docker Compose: In your
docker-compose.yml, add adnssection underservicesto use specific DNS servers:services: api: image: langgenius/dify-api:0.3.2 dns: - 8.8.8.8 - 8.8.4.4 -
Check Network Configuration: Ensure Docker containers are not in a network mode that isolates them from external access.
-
Restart Containers: Apply changes by restarting your Docker containers:
docker compose down docker compose up -d -
Test DNS Resolution: Verify DNS settings by executing
ping google.comornslookup google.comwithin a container.
Regarding the HTTP response code 114514 and the "image_url" field in the custom tool interface, ensure that your DNS resolution is functioning correctly first, as this could be affecting the ability to make HTTP requests and resolve URLs properly. If the DNS issue is resolved and you still encounter unusual behavior or response codes, it may be necessary to investigate the application's code or configuration for errors or custom implementations that deviate from standard HTTP response codes.
Details
Sources
- en/getting-started/install-self-hosted/docker-compose.md
- en/features/workflow/node/http-request.md
- api/tests/integration_tests/workflow/nodes/test_http.py
- api/core/workflow/nodes/http_request/http_request_node.py
- docker/docker-compose.yaml
- en/tutorials/advanced-tool-integration.md
- zh_CN/guides/tools/advanced-tool-integration.md
- web/app/components/base/image-uploader/image-link-input.tsx
- api/controllers/console/error.py
- api/controllers/console/app/error.py
- en/getting-started/install-self-hosted/environments.md
- docker/docker-compose.middleware.yaml
About Dosu This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
To continue the conversation, mention @dosu.
thanks, it looks worked! 😄