502 Timeout Error
Getting Sandbox timeout errors all the time, could you please help me what can be wrong here?
import dotenv from 'dotenv'
import { Sandbox } from '@e2b/code-interpreter'
dotenv.config()
const sandbox = await Sandbox.create("code-interpreter-v1", {
timeoutMs: 300000,
requestTimeoutMs: 300000,
})
const execution = await sandbox.runCode('x = 1;x+=1; x')
console.log(execution.text)
Error Response
return new import_e2b.TimeoutError(
^
TimeoutError: <html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.27.0</center>
</body>
</html>
: This error is likely due to sandbox timeout. You can modify the sandbox timeout by passing 'timeoutMs' when starting the sandbox or calling '.setTimeout' on the sandbox with the desired timeout.
Is this running on the e2b cloud or your self-hosted version? If it's the self-hosted version, could you check if you included the start command when building the code interpreter template?
Hey @jakubno, Yes its self-hosted version, i am following according to docs https://e2b.dev/docs/quickstart/install-custom-packages
Here is e2b.Dockerfile
FROM e2bdev/code-interpreter:latest
# Install some Python packages
RUN pip install cowsay
Getting this while building template with build start cmd.
Error getting template build status: [500] internal server error: Failed to get the default team
I got the same issue error 500 fetch failed。 use e2b cloud
Hey @manavAt1flow , are you still getting this on the latest infra version?
Yes @mlejva still getting internal server error: Failed to get the default team, usually this behavior is random every time i perform the build command, it gives different errors, on 2nd attempt it gives me this error
Error building environment: error snapshot for env 'td88rtwzob9e43xoum45' during build '5797379a-24c7-429b-be02-f381e3577f8d': error snapshotting fc: error creating vm snapshot: [PUT /snapshot/create][400] createSnapshotBadRequest &{FaultMessage:Create snapshot error: Cannot write memory file: Cannot dump memory: Guest memory error: Bad address (os error 14)}Build failed: error when building env: error when building env: rpc error: code = Unknown desc = error snapshot for env 'td88rtwzob9e43xoum45' during build '5797379a-24c7-429b-be02-f381e3577f8d': error snapshotting fc: error creating vm snapshot: [PUT /snapshot/create][400] createSnapshotBadRequest &{FaultMessage:Create snapshot error: Cannot write memory file: Cannot dump memory: Guest memory error: Bad address (os error 14)}
and on third attempt it gets succeeded.