I am using vercel sandboxes for a project. To establish live updates from the sandbox, I am periodically running a command on it. Every 1-3 sec. During dev my IP got regularly blocked due to that. Can I expect the same for deployment?
The questions boils down to:
are there rate limits or other limits on the commands executed in a sandbox?
does the IP block apply only to dev environments or equally to deployments?
If the limitation applies to deployments as well, will different users accessing the app have different limits or is it cumulative?
In my app I am creating a sandbox, running an agent in it to modify some files. To get the state of the files, I periodically run git add -N . git diff <initial commit>
After a while, my IP get’s blocked, likely due to the rate or amount of requests sent to the Sandbox.
These rate limits are not specified in the documentaiton:
Only after enabling a VPN it started working again, hence the conclusion.
The exact error is a TLS disconnect due to an IP block.
When using Vercel CLI after the block, I get:
Error: An unexpected error occurred in whoami: FetchError: request to https://api.vercel.com/v2/user failed, reason: Client network socket disconnected before secure TLS connection was established
In the code I get:
```
Sandbox creation error: TypeError: fetch failed
at async createSandbox (lib/sandbox/creation.ts:271:17)
at async processTask (app/api/tasks/route.ts:370:27)
at async processTaskWithTimeout (app/api/tasks/route.ts:242:5)
269 | let sandbox: Sandbox
270 | try {
> 271 | sandbox = await Sandbox.create(sandboxConfig)
| ^
272 | await logger.info('Sandbox created successfully')
273 | await logger.info('Sandbox timeout set to ' + sandboxConfig.timeout / 60000 + ' minutes')
274 | {
[cause]: [Error: Client network socket disconnected before secure TLS connection was established] {
code: 'ECONNRESET',
path: undefined,
host: 'api.vercel.com',
port: 443,
localAddress: null
}
}
Hi @philtrigu, thanks for providing additional context. May I know what is the duration you’ve set the sandbox and do the errors start popping up right away or after say x minutes or x attempts?
Frequency shifted during development and sometimes several sandboxes woudl be running at the same time.
Originally it was set to 1 sec, then 2.5, sometimes for experimentattion 0.5 and finally increased to 15 (after the problem became clear).
The problem is that multiple users would use the app. It is not clear to me, whether their usage is treated interchangibly (thus drastically lowering the frequency) or not. It’s also not clear, what max level of usage such a rate limit imposes.
Hi @philtrigu, I understand your use case. Our team is digging in to why this has happening for your use case. Keeping a long interval between polling is good workaround for now.
I’ll share here when I’ve more information about this.