dify icon indicating copy to clipboard operation
dify copied to clipboard

Unable to make http request either in http node or custom tool and return [Errno -3]

Open DavinciEvans opened this issue 1 year ago • 1 comments

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:

20240515173458

tool:

20240515173947

✔️ Expected Behavior

http return correctly.

❌ Actual Behavior

No response

DavinciEvans avatar May 15 '24 09:05 DavinciEvans

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:

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

  2. Specify DNS in Docker Compose: In your docker-compose.yml, add a dns section under services to use specific DNS servers:

    services:
      api:
        image: langgenius/dify-api:0.3.2
        dns:
          - 8.8.8.8
          - 8.8.4.4
    
  3. Check Network Configuration: Ensure Docker containers are not in a network mode that isolates them from external access.

  4. Restart Containers: Apply changes by restarting your Docker containers:

    docker compose down
    docker compose up -d
    
  5. Test DNS Resolution: Verify DNS settings by executing ping google.com or nslookup google.com within 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


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.

dosubot[bot] avatar May 15 '24 09:05 dosubot[bot]

thanks, it looks worked! 😄

DavinciEvans avatar May 16 '24 01:05 DavinciEvans