The "Code Execution" component failed to execute
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] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
- [x] Please do not modify this template :) and fill in all the required fields.
Dify version
1.0.1
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
The "code execution" component failed to execute
After upgrading, it will fail: "Failed to execute code, which is likely a network issue, please check if the sandbox service is running. ( Error: [Errno -2] Name or service not known )"
I found that after executing, the sandbox has been in a state of restarting: "docker-sandbox-1 langgenius/dify-sandbox:0.2.10 "/main" sandbox 11 minutes ago Restarting (2) 29 seconds ago"
✔️ Expected Behavior
No response
❌ Actual Behavior
No response
I found some similar issues that might help you resolve the problem with the "Code Execution" component failing due to a network issue.
-
Open Issue: A similar issue was reported where the sandbox's network configuration in the
docker-compose.yamlfile was not set correctly, causing problems when executing code in the sandbox. The suggested solution is to add the 'default' network to the Dify sandbox configuration. This allows the sandbox to connect to both the 'ssrf_proxy_network' and the 'default' network, which might resolve network-related issues [1]. -
Closed Issue: Another issue suggested modifying Docker's DNS settings to resolve temporary failures in name resolution. This involves editing the Docker daemon configuration file (
/etc/docker/daemon.json) to specify DNS servers and adding adnssection underservicesin yourdocker-compose.yml. Restarting the Docker daemon and containers afterward might help [2].
These solutions focus on ensuring the sandbox service is correctly configured and can resolve network names. You might want to check your docker-compose.yaml and DNS settings as described.
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other
Python code that worked fine on the previous version of Dify will fail after the upgrade
Turn off the proxy and try it again.
My javascript code that worked fine on the previous version of Dify will fail after the upgrade to 1.0.1
Turn off the proxy and try it again.
I restart docker-compose(down and up). It does not work.
检查一下,是不是volumes里面没有这个文件,需要从github下载手工放进去。 https://github.com/langgenius/dify/blob/main/docker/volumes/sandbox/conf/config.yaml
检查一下,是不是volumes里面没有这个文件,需要从github下载手工放进去。 https://github.com/langgenius/dify/blob/main/docker/volumes/sandbox/conf/config.yaml
This is useful to me! But I hope the official can give clear instructions when upgrading Docker.
检查一下,是不是volumes里面没有这个文件,需要从github下载手工放进去。 https://github.com/langgenius/dify/blob/main/docker/volumes/sandbox/conf/config.yaml
this is useful to me to solve my problem, thanks
检查一下,是不是volumes里面没有这个文件,需要从github下载手工放进去。 https://github.com/langgenius/dify/blob/main/docker/volumes/sandbox/conf/config.yaml
This is useful for me! I have the same problem. Very Good! But I think It will be better if the official gives the default config information or gives the clear instruction info