The http requests in code node failed after upgrading to v 0.14.0 #7234

Closed
opened 2026-02-21 18:19:34 -05:00 by yindo · 2 comments
Owner

Originally created by @Halfknow on GitHub (Dec 17, 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.14.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Upgrading to version 0.14.0, the python code node to execute the requests code, the network error occur.

✔️ Expected Behavior

In the previous version from 0.8.0 to 0.13.2, the requests function in python code node works fine.

Actual Behavior

Now in 0.14.0 version, the python code node to execute the http requests failed. The error message is below:

Run failed: Failed to execute code, which is likely a network issue, please check if the sandbox service is running. ( Error: [Errno 111] Connection refused )

Originally created by @Halfknow on GitHub (Dec 17, 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.14.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Upgrading to version 0.14.0, the python code node to execute the requests code, the network error occur. ### ✔️ Expected Behavior In the previous version from 0.8.0 to 0.13.2, the requests function in python code node works fine. ### ❌ Actual Behavior Now in 0.14.0 version, the python code node to execute the http requests failed. The error message is below: `Run failed: Failed to execute code, which is likely a network issue, please check if the sandbox service is running. ( Error: [Errno 111] Connection refused )`
yindo added the 🐞 bug🤔 cant-reproduce labels 2026-02-21 18:19:34 -05:00
yindo closed this issue 2026-02-21 18:19:34 -05:00
Author
Owner

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

I found some similar threads that might be relevant to your issue:

  1. sandbox can't use - This discussion is unsolved and might provide some insights into sandbox-related issues [1].

  2. Unable to use external HTTP requests after installing Dify with docker-compose on Ubuntu - Another unsolved discussion that could be related to network configuration issues [2].

  3. Node Code run failed - This discussion is also unsolved but might have relevant information regarding network issues in the code node [3].

For the error message you're encountering, it seems to be related to network configuration or the sandbox service not running properly. Here are some steps you can take to troubleshoot and potentially resolve the issue:

  1. Check Sandbox Service: Ensure that the sandbox service is running. You can verify this by checking the logs and health status of the sandbox container.

  2. Network Configuration: Review the network settings in your docker-compose.yaml file. The sandbox service should be connected to the correct network, and the SANDBOX_ENABLE_NETWORK environment variable should be set to true to allow network access [4].

  3. Environment Variables: Make sure all necessary environment variables for the sandbox service are correctly set, including SANDBOX_API_KEY, SANDBOX_GIN_MODE, SANDBOX_WORKER_TIMEOUT, SANDBOX_HTTP_PROXY, and SANDBOX_HTTPS_PROXY [5].

  4. Docker Network: Ensure that both the web interface and the sandbox service are on the same Docker network. This can be configured in your docker-compose.yaml under the networks section [6].

These steps should help you identify and resolve the network issue causing the HTTP requests to fail in the code node.

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 17, 2024): <!-- Answer --> I found some similar threads that might be relevant to your issue: 1. [sandbox can't use](https://github.com/langgenius/dify/discussions/8612) - This discussion is unsolved and might provide some insights into sandbox-related issues <sup>[[1]](https://github.com/langgenius/dify/discussions/8612)</sup>. 2. [Unable to use external HTTP requests after installing Dify with docker-compose on Ubuntu](https://github.com/langgenius/dify/discussions/8423) - Another unsolved discussion that could be related to network configuration issues <sup>[[2]](https://github.com/langgenius/dify/discussions/8423)</sup>. 3. [Node Code run failed](https://github.com/langgenius/dify/discussions/7902) - This discussion is also unsolved but might have relevant information regarding network issues in the code node <sup>[[3]](https://github.com/langgenius/dify/discussions/7902)</sup>. For the error message you're encountering, it seems to be related to network configuration or the sandbox service not running properly. Here are some steps you can take to troubleshoot and potentially resolve the issue: 1. **Check Sandbox Service**: Ensure that the sandbox service is running. You can verify this by checking the logs and health status of the sandbox container. 2. **Network Configuration**: Review the network settings in your `docker-compose.yaml` file. The sandbox service should be connected to the correct network, and the `SANDBOX_ENABLE_NETWORK` environment variable should be set to `true` to allow network access <sup>[[4]](https://github.com/langgenius/dify/blob/main/docker/docker-compose.middleware.yaml)</sup>. 3. **Environment Variables**: Make sure all necessary environment variables for the sandbox service are correctly set, including `SANDBOX_API_KEY`, `SANDBOX_GIN_MODE`, `SANDBOX_WORKER_TIMEOUT`, `SANDBOX_HTTP_PROXY`, and `SANDBOX_HTTPS_PROXY` <sup>[[5]](https://github.com/langgenius/dify/issues/7901)</sup>. 4. **Docker Network**: Ensure that both the web interface and the sandbox service are on the same Docker network. This can be configured in your `docker-compose.yaml` under the `networks` section <sup>[[6]](https://github.com/langgenius/dify/issues/3956)</sup>. These steps should help you identify and resolve the network issue causing the HTTP requests to fail in the code node. <!-- 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/69686b0b-f4d0-4268-8f2d-e6cbd70f01f9?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/69686b0b-f4d0-4268-8f2d-e6cbd70f01f9?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/69686b0b-f4d0-4268-8f2d-e6cbd70f01f9?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/69686b0b-f4d0-4268-8f2d-e6cbd70f01f9?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/69686b0b-f4d0-4268-8f2d-e6cbd70f01f9?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/69686b0b-f4d0-4268-8f2d-e6cbd70f01f9?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Dec 17, 2024):

If you are upgrading from older version, check the env settings suggested by the bot/

@crazywoola commented on GitHub (Dec 17, 2024): If you are upgrading from older version, check the env settings suggested by the bot/
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#7234