1

I'm uploading several thousand files through the Box API, and after a few hundred uploads I'm getting a 502 Server Connection Closed error (and the response is HTML, not JSON as I would expect). Average file size is 0.5M

The errors seem to be mostly affecting the larger files, but this could just be because it is more likely for the larger files to be mid-upload when the upload fails.

I'm also retrying files on 502 failures, and I sometimes get a general 500 error response, or sometimes a local ETIMEDOUT or a socket hang up error (I'm uploading using the Node request library). Any thought as to what is the problem here? Is it that Box is somehow having trouble with the amount of stuff I'm uploading from my local computer? (I would doubt that though.)

troyastorino
  • 235
  • 4
  • 13

1 Answers1

1

It seems like this the problem was just overloading Box with requests. I was doing uploads in parallel, and after lowering the parallelism the 502 errors stopped coming up. If I kept parallelism high, when I retried requests that errored out enough times, the requests eventually went through.

troyastorino
  • 235
  • 4
  • 13
  • 1
    With regard to parallelism, the feedback I've gotten from Box is that you want to aim for a max of 10 requests/second for a single access token working on behalf of a single user. If you are using an enterprise auth token and executing calls on behalf of other users (i.e. As-User) then the cap applies separately to each one. – John Hoerr Jun 02 '15 at 14:16
  • Thanks John! That's very valuable info. Makes sense! – troyastorino Jun 04 '15 at 17:37