Skip to main content
Question

Stream Closed exceptions

  • July 3, 2026
  • 0 replies
  • 8 views

Using the Box Java SDK v10:

During a high volume of uploads I occasionally see a “Stream already closed” exception.  This appears to be caused by a retry attempt on a 429 response from the original upload request.  It appears that the Box SDK attempts to retry the upload without resetting the stream so the stream has been read.

 

I have written a custom RetryStrategy that resets the stream before a retry and this fixes the issue.  It seems like this should be part of the retry code or is this the expected way to handle retry attempts for uploads?