Uploaded image for project: 'Commons FileUpload'
  1. Commons FileUpload
  2. FILEUPLOAD-71

[fileupload] FileUploadException: Processing of multipart/form-data request failed. Read timed out

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Invalid
    • Affects Version/s: 1.0 Final
    • Fix Version/s: 1.2
    • Labels:
      None
    • Environment:

      Operating System: other
      Platform: Other

    • Bugzilla Id:
      36312

      Description

      Commons file upload is used bu the struts to upload the files from the disk. I
      got the following error. I think this happens when the size of file is bit
      large. I have tried to upload xml files with size 8-9 KB. Sometimes I was able
      to upload and sometimes it failed.
      Details:
      Platform: Fedora core 3
      Version used: commons-fileupload-1.0-rc1.jar
      Please checkout this link also
      (http://www.jroller.com/page/gstamp?entry=file_upload_problem_read_timed)

      org.apache.commons.fileupload.FileUploadException: Processing of
      multipart/form-data request failed. Read timed out
      at
      org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:429)
      at
      org.apache.struts.upload.CommonsMultipartRequestHandler.handleRequest(CommonsMultipartRequestHandler.java:195)
      at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:445)
      at
      org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:798)
      at
      com.valista.core.node.ui.system.StrutsRequestProcessor.process(Unknown Source)
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
      at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at

        Activity

        Hide
        martinc Martin Cooper added a comment -
            • COM-2302 has been marked as a duplicate of this bug. ***
        Show
        martinc Martin Cooper added a comment - COM-2302 has been marked as a duplicate of this bug. ***
        Hide
        martinc Martin Cooper added a comment -

        Are you seeing this with the browser pointing directly at Tomcat, or do you have
        something like JK2 / ISAPI_redirector2 in between? Every time this issue has
        come up, it has been because of something in between the browser and FileUpload.
        As stated in the link you provided, fixes have been made to JK2 /
        ISAPI_redirector2 that resolve this issue.

        Show
        martinc Martin Cooper added a comment - Are you seeing this with the browser pointing directly at Tomcat, or do you have something like JK2 / ISAPI_redirector2 in between? Every time this issue has come up, it has been because of something in between the browser and FileUpload. As stated in the link you provided, fixes have been made to JK2 / ISAPI_redirector2 that resolve this issue.
        Hide
        amila_nava@yahoo.com amila navarathna added a comment -

        We do not use Tomcat, instead, we use bea weblogic server to deploy our web
        apps. We use struts for our web UIs.

        Show
        amila_nava@yahoo.com amila navarathna added a comment - We do not use Tomcat, instead, we use bea weblogic server to deploy our web apps. We use struts for our web UIs.
        Hide
        chester75 Johannes Staber added a comment -

        I have exactly same problem with file-upload (weblogic, struts, commons-fileupload1.0). Is there any solution available?

        Show
        chester75 Johannes Staber added a comment - I have exactly same problem with file-upload (weblogic, struts, commons-fileupload1.0). Is there any solution available?
        Hide
        mgpayne Michael Payne added a comment -

        I am seeing a similar issue on weblogic 8, commons-fileupload 1.1. We do not use a framework. When submitting a multipart request with no file data, we get the following exception:

        org.apache.commons.fileupload.FileUploadException: Processing of multipart/form-data request failed. Read timed out
        at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:384)
        at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:116)

        In IE, the user sees a file download box because of the error, which is highly undesirable. If the form is resubmitted a second time, it works.

        Show
        mgpayne Michael Payne added a comment - I am seeing a similar issue on weblogic 8, commons-fileupload 1.1. We do not use a framework. When submitting a multipart request with no file data, we get the following exception: org.apache.commons.fileupload.FileUploadException: Processing of multipart/form-data request failed. Read timed out at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:384) at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:116) In IE, the user sees a file download box because of the error, which is highly undesirable. If the form is resubmitted a second time, it works.
        Hide
        bayard Henri Yandell added a comment -

        Does anyone have a test case? I've got access to Weblogic servers at work (and some ex-BEA people) so could do some investigating. Much easier/quicker if someone can attach a simple test case showing the problem.

        Show
        bayard Henri Yandell added a comment - Does anyone have a test case? I've got access to Weblogic servers at work (and some ex-BEA people) so could do some investigating. Much easier/quicker if someone can attach a simple test case showing the problem.
        Hide
        jochen@apache.org Jochen Wiedmann added a comment -

        I do believe, that such errors aren't in the scope of commons-fileupload. We do a read on the ServletInputStream or whatever we receive and trust that it works.

        The only thing I can see that we could do is to provide more information by returning the cause to the user.

        Show
        jochen@apache.org Jochen Wiedmann added a comment - I do believe, that such errors aren't in the scope of commons-fileupload. We do a read on the ServletInputStream or whatever we receive and trust that it works. The only thing I can see that we could do is to provide more information by returning the cause to the user.
        Hide
        jochen@apache.org Jochen Wiedmann added a comment -

        This issue makes me rethink our error handling. It is much better to throw an IOException, rather than masking it with a FileUploadException. That allows us to clearly distinguish between environmental problems like this and errors in our own libraries or user errors (invalid multipart data), where the FileUploadException is proper.

        Show
        jochen@apache.org Jochen Wiedmann added a comment - This issue makes me rethink our error handling. It is much better to throw an IOException, rather than masking it with a FileUploadException. That allows us to clearly distinguish between environmental problems like this and errors in our own libraries or user errors (invalid multipart data), where the FileUploadException is proper.
        Hide
        smachin Sean Machin added a comment -

        I am also getting this problem occasionally when trying to upload images approx. 8MB in size. This is with Tomcat 5.5.20 on a Fedora Core 5 machine, no connectors, using the latest commons-fileupload-1.1.1.jar. Is there any known solution or work around?

        29 Nov 09:32:13 ERROR http-80-Processor24 org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/hsmgmt].[uploadrelease] - Servlet.service() for servlet uploadrelease threw exception
        org.apache.commons.fileupload.FileUploadException: Processing of multipart/form-data request failed. Read timed out
        at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:384)
        at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:116)
        at com.thresholdcorp.hsmgmt.UploadRelease.doPost(UploadRelease.java:67)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:595)

        Show
        smachin Sean Machin added a comment - I am also getting this problem occasionally when trying to upload images approx. 8MB in size. This is with Tomcat 5.5.20 on a Fedora Core 5 machine, no connectors, using the latest commons-fileupload-1.1.1.jar. Is there any known solution or work around? 29 Nov 09:32:13 ERROR http-80-Processor24 org.apache.catalina.core.ContainerBase. [Catalina] . [localhost] . [/hsmgmt] . [uploadrelease] - Servlet.service() for servlet uploadrelease threw exception org.apache.commons.fileupload.FileUploadException: Processing of multipart/form-data request failed. Read timed out at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:384) at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:116) at com.thresholdcorp.hsmgmt.UploadRelease.doPost(UploadRelease.java:67) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595)
        Hide
        hauser@acm.org Ralf Hauser added a comment -

        we are having the same error message with 53082 Feb 14 2007 WEB-INF/lib/commons-fileupload-1.2.jar

        In order to better debug, it would be great to include in the exception thrown

        1) the starting time, exception time, elapsed time inbetween
        2) the user-agent used to upload - e.g. black-berries had problems with multipart in the past
        3) the amount of bytes uploaded until the exception was thrown

        (CommonsMultipartRequestHandler.java:193) - Failed to parse multipart request
        org.apache.commons.fileupload.FileUploadException: Read timed out
        at
        org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:369)
        at
        org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:302)
        at
        org.apache.struts.upload.CommonsMultipartRequestHandler.handleRequest(CommonsMultipartRequestHandler.java:185)
        at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:405)
        at
        org.apache.struts.chain.commands.servlet.PopulateActionForm.populate(PopulateActionForm.java:50)
        at
        org.apache.struts.chain.commands.AbstractPopulateActionForm.execute(AbstractPopulateActionForm.java:60)
        at
        org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
        at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
        at
        org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
        at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
        at
        org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
        at
        org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)

        Show
        hauser@acm.org Ralf Hauser added a comment - we are having the same error message with 53082 Feb 14 2007 WEB-INF/lib/commons-fileupload-1.2.jar In order to better debug, it would be great to include in the exception thrown 1) the starting time, exception time, elapsed time inbetween 2) the user-agent used to upload - e.g. black-berries had problems with multipart in the past 3) the amount of bytes uploaded until the exception was thrown (CommonsMultipartRequestHandler.java:193) - Failed to parse multipart request org.apache.commons.fileupload.FileUploadException: Read timed out at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:369) at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:302) at org.apache.struts.upload.CommonsMultipartRequestHandler.handleRequest(CommonsMultipartRequestHandler.java:185) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:405) at org.apache.struts.chain.commands.servlet.PopulateActionForm.populate(PopulateActionForm.java:50) at org.apache.struts.chain.commands.AbstractPopulateActionForm.execute(AbstractPopulateActionForm.java:60) at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51) at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190) at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304) at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190) at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
        Hide
        jochen@apache.org Jochen Wiedmann added a comment -

        Ralf, simply log the required information before starting the file upload. If Struts doesn't do this for you, subclass the CommonsMultipartRequestHandler, or do something similar. You don't need changes in FileUpload for that.

        Show
        jochen@apache.org Jochen Wiedmann added a comment - Ralf, simply log the required information before starting the file upload. If Struts doesn't do this for you, subclass the CommonsMultipartRequestHandler, or do something similar. You don't need changes in FileUpload for that.
        Hide
        edp2721 JeongRaePark added a comment -

        오류가 발생하는 피시의 temp internet설정의 폴더 위치명이 너무 길경우 발생함을 확인 했습니다.
        환경변수에서 pc의 temp 위치를 짧은 폴더위치로 변경해 보세요.

        change your pc's temp folder location in environment variable.
        Your temp location is too long to process.

        Show
        edp2721 JeongRaePark added a comment - 오류가 발생하는 피시의 temp internet설정의 폴더 위치명이 너무 길경우 발생함을 확인 했습니다. 환경변수에서 pc의 temp 위치를 짧은 폴더위치로 변경해 보세요. change your pc's temp folder location in environment variable. Your temp location is too long to process.
        Hide
        chtompki Rob Tompkins added a comment -

        jochen.wiedmann - Should this be marked as invalid?

        Show
        chtompki Rob Tompkins added a comment - jochen.wiedmann - Should this be marked as invalid?
        Show
        chtompki Rob Tompkins added a comment - Maybe related to https://github.com/apache/commons-fileupload/commit/684984971e95ac0dff142934323d02df77168126
        Hide
        chtompki Rob Tompkins added a comment -

        In 1.2 tag which has been released.

        Show
        chtompki Rob Tompkins added a comment - In 1.2 tag which has been released.

          People

          • Assignee:
            jochen@apache.org Jochen Wiedmann
            Reporter:
            amila_nava@yahoo.com amila navarathna
          • Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development