Bad Request during bulk upload
We're implementing a bulk upload for the migration tool to Box. We're trying to solve recurring 429 and 5XX errors with the help of the exponential back-off strategy suggested in Box documentation (https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/). In most of the cases it seems to help us to fight with 429 and 5XX errors.
However, when doing a test with ~2000 files I noticed that Box failed to upload 1 of our files and we received 400 Bad Request error for that file.
BoxException: The API returned an error [BadRequest] bad_request - Invalid argument supplied to runmode request: Success(http://loopback-pool.prod.box.net:25200/index.php?from_upload_proxy=1&upload_start=1637933861.663&folder_id=150973568617&upload_type=api_v2&rm=upxy_get_storage_encryption_params_api GET headers: X-From-Upxy:1 Box-Request-Id:7900ec92c0f5bc1e Authorization:Bearer [OUR_TOKEN_HERE] X-Forwarded-For:37.252.89.247, 10.241.4.71, 10.133.60.30) java.nio.channels.UnresolvedAddressException
I manually replaced our token with [OUR_TOKEN_HERE] in the message. We are sure that our token is functional since all next upload requests are succeeding with the same token.
If it will help you to track down the error, the error happened at "Fri, 26 Nov 2021 13:37:41 GMT". Actually, it is the second time we experienced this error. We got similar exception at "Fri, 26 Nov 2021 12:51:16 GMT" as well.
What is the issue here? Are we doing something wrong or it is a bug in the SDK/API itself?
-
Official comment
Hi Steve,
I looked in our logs. I see two 400 status responses for the client_id 7ypzdr66s3m80h3hutop34u7yml8928x. Can you confirm that is the client_id in question? On our side, it looks like it couldn't find the file version you were looking for...
Hope this helps,
Alex, Box Developer Advocate
Comment actions -
Hi Alex. Thanks for the response.
No, the client_id we were using was 8163kbn9cdkf4a9l8lwgi5sholqb3pe1.
And both 400 status responses we've experienced were thrown from FilesManager.UploadAsync method, so we were not looking for a file version there. You can find the original timestamps when the issue was reproduced in the original question.
Let me know if this information is enough. If you want, we can try to reproduce the issue again. -
Thanks for looking for that Alex. We will try to reproduce it again and get back to you then.
Not sure if it will be helpful, but actually I kept our internal logs for Friday when the issue was reproduced. I will copy the full log entry here for further reference.
2021-11-26 17:37:46.1684502 BoxException: The API returned an error [BadRequest] bad_request - Invalid argument supplied to runmode request: Success(http://loopback-pool.prod.box.net:25200/index.php?from_upload_proxy=1&upload_start=1637933861.663&folder_id=150973568617&upload_type=api_v2&rm=upxy_get_storage_encryption_params_api GET headers: X-From-Upxy:1 Box-Request-Id:7900ec92c0f5bc1e Authorization:Bearer [OUR_TOKEN_HERE] X-Forwarded-For:37.252.89.247, 10.241.4.71, 10.133.60.30) java.nio.channels.UnresolvedAddressException Stack: [OUR_STACK_TRACE_HERE]
2021-11-26 17:37:46.1684502 ERROR 400
2021-11-26 17:37:46.1704565 Connection: keep-alive
Strict-Transport-Security: max-age=31536000
Date: Fri, 26 Nov 2021 13:37:41 GMT
Please sign in to leave a comment.
Comments
4 comments