langgenius / dify-sandbox

A lightweight, fast, and secure code execution environment that supports multiple programming languages
https://docs.dify.ai/development/backend/sandbox
Apache License 2.0
412 stars 93 forks source link

Unable to open /dev/urandom #80

Open TheNha opened 1 month ago

TheNha commented 1 month ago

Hi, I install torch version 2.4.1 in docker. I added .so file libraries for torch library, it in internal/static/config_default_amd64.go. If i exec docker container and run pip show torch, it worked.

But I create workflow CODE, and import torch. I got a error. Node Code run failed: Traceback (most recent call last): File "/var/sandbox/sandbox-python/tmp/acf0447c_3fc8_40ba_bf4d_3f20123c4389.py", line 48, in <module> File "<string>", line 3, in <module> File "/usr/local/lib/python3.10/site-packages/torch/__init__.py", line 290, in <module> from torch._C import * # noqa: F403 RuntimeError: Unable to open /dev/urandom error: exit status 255

Please show to config or fix this error. Thanks and regards.