It looks like your code started writing an Excel file (back to the client), received part of the path and found some kind of error. By then it was too late to return and give an HTTP response code with an error of 500. Details of the error are not included in your question. (Maybe the client hung up, the answer was made twice, the exception was caused by the application code, etc.). If you debug your application and break any exception, do you find anything?
You can also try increasing the size of the buffer to see what happens. (4k, 16k, more?) This tells the system to hold onto the stream longer before starting to return it to the client. Thus, your actual problem may appear on top.
source share