Initiating any interface request with Javascript in the "Code Execution" node will result in an error: "errno: -3001, code: 'EAI_AGAIN', syscall: 'getaddrinfo', hostname: 'www.baidu.com'" #7293

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

Originally created by @weiweimaodetuzi on GitHub (Dec 19, 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.6.10

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

image
image

✔️ Expected Behavior

"Code Execution" node can initiating interface request

Actual Behavior

Error: 'EAI_AGAIN'

Originally created by @weiweimaodetuzi on GitHub (Dec 19, 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.6.10 ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce ![image](https://github.com/user-attachments/assets/4bd94bb1-0192-46f9-9500-f4d4d0dc716f) ![image](https://github.com/user-attachments/assets/af749cc8-29c7-44aa-af1e-a678b2dc955e) ### ✔️ Expected Behavior "Code Execution" node can initiating interface request ### ❌ Actual Behavior Error: 'EAI_AGAIN'
yindo added the 🐞 bug🤔 cant-reproduce labels 2026-02-21 18:19:52 -05:00
yindo closed this issue 2026-02-21 18:19:52 -05:00
Author
Owner

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

@weiweimaodetuzi Hello there! I'm here to help you with any bugs, questions, or contributions. Let's work together to solve this issue.

The error EAI_AGAIN typically indicates a DNS resolution issue, meaning the system is having trouble resolving the hostname to an IP address. In Dify's self-hosted environment, the 'Code Execution' node is sandboxed for security reasons, which restricts network requests, including DNS lookups [1][2][3].

To address this issue, you might consider the following steps:

  1. Check DNS Configuration: Ensure that the DNS settings on your self-hosted environment are correctly configured. This might involve checking your Docker or server network settings to ensure they can resolve external hostnames.

  2. Network Access: Verify that the sandbox environment has the necessary permissions to access external networks. This might require adjusting firewall settings or network policies.

  3. Local DNS Server: If possible, configure a local DNS server that the sandbox can access, which might help in resolving external hostnames more reliably.

  4. Alternative Testing: As a workaround, test the network request outside of the sandboxed environment to ensure that the issue is specific to the sandbox restrictions.

These steps should help in diagnosing and potentially resolving the DNS resolution issue you're encountering.

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 19, 2024): <!-- Greeting --> @weiweimaodetuzi Hello there! I'm here to help you with any bugs, questions, or contributions. Let's work together to solve this issue. <!-- Answer --> The error `EAI_AGAIN` typically indicates a DNS resolution issue, meaning the system is having trouble resolving the hostname to an IP address. In Dify's self-hosted environment, the 'Code Execution' node is sandboxed for security reasons, which restricts network requests, including DNS lookups <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/en/guides/workflow/node/code.md)</sup><sup>[[2]](https://github.com/langgenius/dify-docs/blob/main/jp/guides/workflow/node/code.md)</sup><sup>[[3]](https://github.com/langgenius/dify-docs/blob/main/zh_CN/guides/workflow/node/code.md)</sup>. To address this issue, you might consider the following steps: 1. **Check DNS Configuration**: Ensure that the DNS settings on your self-hosted environment are correctly configured. This might involve checking your Docker or server network settings to ensure they can resolve external hostnames. 2. **Network Access**: Verify that the sandbox environment has the necessary permissions to access external networks. This might require adjusting firewall settings or network policies. 3. **Local DNS Server**: If possible, configure a local DNS server that the sandbox can access, which might help in resolving external hostnames more reliably. 4. **Alternative Testing**: As a workaround, test the network request outside of the sandboxed environment to ensure that the issue is specific to the sandbox restrictions. These steps should help in diagnosing and potentially resolving the DNS resolution issue you're encountering. <!-- 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/30168f86-eab1-43cf-951d-76a76ccb5f28?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/30168f86-eab1-43cf-951d-76a76ccb5f28?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/30168f86-eab1-43cf-951d-76a76ccb5f28?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/30168f86-eab1-43cf-951d-76a76ccb5f28?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/30168f86-eab1-43cf-951d-76a76ccb5f28?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/30168f86-eab1-43cf-951d-76a76ccb5f28?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#7293