Sandbox service start #8520
Replies: 8 comments
-
I found a similar closed issue that might help you. The issue was about the sandbox service listening on a random port instead of the specified 8194 port when deployed on Kubernetes. The suggested solution was to use a "Headless service" and set the To start the sandbox service on a specific IP and port and verify it, you can modify the
|
Beta Was this translation helpful? Give feedback.
-
i am not using docker i deployed in local server |
Beta Was this translation helpful? Give feedback.
-
Error: Failed to execute code, got status code 404, please check if the sandbox service is running |
Beta Was this translation helpful? Give feedback.
-
{ |
Beta Was this translation helpful? Give feedback.
-
Local Deployment of sandbox not using docker .? |
Beta Was this translation helpful? Give feedback.
-
To resolve the "Failed to execute code, got status code 404" error when deploying the sandbox service on a local server without using Docker, you need to ensure that the sandbox service is correctly running and accessible at the expected endpoint. Here are the steps to troubleshoot and resolve the issue:
Here is a snippet of the relevant code for context: url = URL(str(dify_config.CODE_EXECUTION_ENDPOINT)) / "v1" / "sandbox" / "run"
headers = {"X-Api-Key": dify_config.CODE_EXECUTION_API_KEY}
data = {
"language": cls.code_language_to_running_language.get(language),
"code": code,
"preload": preload,
"enable_network": True,
}
response = post(
str(url),
json=data,
headers=headers,
timeout=Timeout(
connect=dify_config.CODE_EXECUTION_CONNECT_TIMEOUT,
read=dify_config.CODE_EXECUTION_READ_TIMEOUT,
write=dify_config.CODE_EXECUTION_WRITE_TIMEOUT,
pool=None,
),
)
if response.status_code == 503:
raise CodeExecutionError("Code execution service is unavailable")
elif response.status_code != 200:
raise Exception(
f"Failed to execute code, got status code {response.status_code},"
f" please check if the sandbox service is running"
) By following these steps, you should be able to identify and resolve the issue causing the 404 error [1]. To start the sandbox service on a local server without using Docker, follow these exact steps:
|
Beta Was this translation helpful? Give feedback.
-
i got this error on curl command curl http://localhost:8194/v1/sandbox/run
|
Beta Was this translation helpful? Give feedback.
-
Self Checks
Dify version
0.6.15
Cloud or Self Hosted
Self Hosted (Source)
Steps to reproduce
In my local server i update all the necessary url for code execution in env file but how sandbox service is running in 8194 port how to start the sandbox service in specific Ip and port and verify
✔️ Expected Behavior
code Execution in workflow to get proper output
❌ Actual Behavior
timeout error
Beta Was this translation helpful? Give feedback.
All reactions