IP blocked when using Sandbox - Same for deployment?

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?

Best,

Filipp

Hi @philtrigu, welcome to the Vercel Community!

Can you share the code snippet to give us some clarity into what might have gotten your IP blocked? What is the exact error message you get?

I’m asking because I was syncing files with sandbox and didn’t face any issues.

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:

Why do I think it’s a rate limit?
I’ve attempted:

  • flushing my DNS
  • resetting the laptop
  • running a network analysis

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
  }
}
1 Like

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?

The duration on dev is 20 minutes, on prod 300.

The errors do pop up only towards the end of the day and only when creating new sandboxes or using a vercel cli command.

The errors disappear the next morning.

1 Like

Thanks for confirming. And what’s the frequency of the commands (git add) that you run?

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.

For Vercel Functions this is neatly explained here f.e.: What is Vercel's policy regarding load testing deployments?

1 Like

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.

1 Like