langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
49.02k stars 7.01k forks source link

Run failed: Failed to execute code, which is likely a network issue, please check if the sandbox service is running. ( Error: Failed to execute code, got status code 502, please check if the sandbox service is running ) #9737

Open Megadeth9919 opened 4 hours ago

Megadeth9919 commented 4 hours ago

Self Checks

Dify version

0.9.2

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

  1. Start with Local Source Code without frontend
  2. Start Frontend Docker Container Separately
  3. Then create a demo workflow with code executor like this image

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

dosubot[bot] commented 4 hours ago

@Megadeth9919 Hello there! I'm here to help you with bugs, questions, and becoming a contributor. Let's squash those bugs together! 🤖

I found some similar issues and discussions that might help you resolve the 502 error related to the sandbox service in your self-hosted Dify environment:

  1. Local Docker Setup Failure - This discussion is open and might contain relevant troubleshooting steps for Docker setup issues [1].

  2. Sandbox can't use - This is another open discussion that addresses issues with the sandbox service [2].

  3. Sandbox service start - This discussion is also open and might provide insights into starting the sandbox service correctly [3].

For resolving the 502 error, ensure the following:

These steps should help you troubleshoot and resolve the 502 error in your Dify setup.

To continue talking to Dosu, mention @dosu.

Megadeth9919 commented 4 hours ago

local api server log

2024-10-23 13:47:28,357.357 INFO [Thread-4423 (process_request_thread)] [_internal.py:97] - 127.0.0.1 - - [23/Oct/2024 13:47:28] "POST /console/api/apps/9cf38c92-14a7-4332-94d4-27d434680235/advanced-chat/workflows/draft/run HTTP/1.1" 200 - 2024-10-23 13:47:28,805.805 INFO [Thread-4424 (_generate_worker)] [_client.py:1038] - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/chat/completions "HTTP/1.1 200 OK" 2024-10-23 13:47:30,946.946 INFO [Thread-4424 (_generate_worker)] [_client.py:1038] - HTTP Request: POST http://127.0.0.1:8194/v1/sandbox/run "HTTP/1.1 502 Bad Gateway"

docker-ssrf_proxy-1 log

(empty)

docker-sandbox-1 log

2024-10-23 21:50:02 [GIN] 2024/10/23 - 13:50:02 | 200 | 41.25µs | ::1 | GET "/health" 2024-10-23 21:50:32 [GIN] 2024/10/23 - 13:50:32 | 200 | 32.272µs | ::1 | GET "/health" 2024-10-23 21:51:02 [GIN] 2024/10/23 - 13:51:02 | 200 | 43.875µs | ::1 | GET "/health" 2024-10-23 21:51:32 [GIN] 2024/10/23 - 13:51:32 | 200 | 33.745µs | ::1 | GET "/health"