I am getting the following issue on the multipart/form-data request

org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request; nested exception is java.io.IOException: org.apache.tomcat.util.http.fileupload.impl.IOFileUploadException: Processing of multipart/form-data request failed. java.io.EOFException
at org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.handleParseFailure(StandardMultipartHttpServletRequest.java:124)
at org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.parseRequest(StandardMultipartHttpServletRequest.java:115)
at org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.initializeMultipart(StandardMultipartHttpServletRequest.java:129)

This happens randomly. On successive request, it works.

Comment From: kse-music

Because the client has been disconnected, but the server is still reading the upload's file stream

Comment From: SwapnilThange

okay. but at the client-side, I see the following exception,

=====> latestError/ErrorType <=====
java.net.SocketException
=====> latestError/Message <=====
Connection closed by remote host
=====> latestError/Stacktrace <=====
com.***.ApiException: java.net.SocketTimeoutException: timeout

as per the exception i see it blames the server for closing the connection

Comment From: bclozel

This likely means that a network failure happened between the two; maybe a proxy closing persistent connections, or limiting request sizes? Unless you can come up with a reproducible test case that points to Spring Boot, I'd suggest looking into network issues and capturing traffic to understand what's going on.