Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-5055

Exception while uploading huge files

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.2
    • Fix Version/s: 2.5 M1
    • Component/s: {Unused} Core
    • Labels:
      None
    • Environment:
    • Tests:
      Integration
    • Difficulty:
      Unknown
    • Similar issues:

      Description

      While trying to upload a huge file, the following exception is fired:

      2010-03-26 11:36:43,050 [http://wikilinux.gidi.it:8081/xwiki/bin/upload/Prova/Pagina1] WARN  web.UploadAction                - Saving uploaded file failed
      com.xpn.xwiki.XWikiException: Error number 3232 in 3: Exception while saving attachment <huge_file_name> of document Prova.Pagina1
      Wrapped Exception: Error number 3004 in 3: Exception while manipulating the archive for file <huge_file_name>
      Wrapped Exception: null
              at com.xpn.xwiki.store.XWikiHibernateAttachmentStore.saveAttachmentContent(XWikiHibernateAttachmentStore.java:122)
              at com.xpn.xwiki.doc.XWikiDocument.saveAttachmentContent(XWikiDocument.java:3726)
              at com.xpn.xwiki.web.UploadAction.uploadAttachment(UploadAction.java:189)
              at com.xpn.xwiki.web.UploadAction.action(UploadAction.java:106)
              at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:213)
              at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:115)
              at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
              at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
              at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
              at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
              at com.xpn.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:152)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
              at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:118)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
              at com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:68)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
              at com.xpn.xwiki.web.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:295)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
              at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
              at org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:276)
              at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:81)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
              at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
              at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
              at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
              at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
              at java.lang.Thread.run(Thread.java:619)
      Wrapped Exception:
      com.xpn.xwiki.XWikiException: Error number 3004 in 3: Exception while manipulating the archive for file ibmlotusnotes-8.5.i586.rpm
      Wrapped Exception: null
              at com.xpn.xwiki.doc.XWikiAttachmentArchive.updateArchive(XWikiAttachmentArchive.java:139)
              at com.xpn.xwiki.doc.XWikiAttachment.updateContentArchive(XWikiAttachment.java:548)
              at com.xpn.xwiki.store.XWikiHibernateAttachmentStore.saveAttachmentContent(XWikiHibernateAttachmentStore.java:79)
              at com.xpn.xwiki.doc.XWikiDocument.saveAttachmentContent(XWikiDocument.java:3726)
              at com.xpn.xwiki.web.UploadAction.uploadAttachment(UploadAction.java:189)
              at com.xpn.xwiki.web.UploadAction.action(UploadAction.java:106)
              at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:213)
              at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:115)
              at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
              at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
              at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
              at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
              at com.xpn.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:152)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
              at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:118)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
              at com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:68)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
              at com.xpn.xwiki.web.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:295)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
              at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
              at org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:276)
              at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:81)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
              at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
              at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
              at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
              at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
              at java.lang.Thread.run(Thread.java:619)
      Wrapped Exception:
      java.lang.NegativeArraySizeException
              at org.apache.commons.codec.binary.Base64.encodeBase64(Base64.java:258)
              at org.apache.commons.codec.binary.Base64.encodeBase64(Base64.java:178)
              at com.xpn.xwiki.doc.XWikiAttachment.toXML(XWikiAttachment.java:351)
              at com.xpn.xwiki.doc.XWikiAttachment.toStringXML(XWikiAttachment.java:290)
              at com.xpn.xwiki.doc.XWikiAttachmentArchive.updateArchive(XWikiAttachmentArchive.java:129)
              at com.xpn.xwiki.doc.XWikiAttachment.updateContentArchive(XWikiAttachment.java:548)
              at com.xpn.xwiki.store.XWikiHibernateAttachmentStore.saveAttachmentContent(XWikiHibernateAttachmentStore.java:79)
              at com.xpn.xwiki.doc.XWikiDocument.saveAttachmentContent(XWikiDocument.java:3726)
              at com.xpn.xwiki.web.UploadAction.uploadAttachment(UploadAction.java:189)
              at com.xpn.xwiki.web.UploadAction.action(UploadAction.java:106)
              at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:213)
              at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:115)
              at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
              at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
              at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
              at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
              at com.xpn.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:152)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
              at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:118)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
              at com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:68)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
              at com.xpn.xwiki.web.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:295)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
              at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
              at org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:276)
              at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:81)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
              at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
              at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
              at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
              at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
              at java.lang.Thread.run(Thread.java:619)
      

      The file size is about 330MB. The strange behaviour is the following:

      • the page refreshes showing the attachment with the right size, and if i try to download it just after the uploading phase, the attachment seems to be present in the database, (but it's not!!!) so i can download it without any problem.
      • if i restart the server or wait a lot of time, the file isn't available anymore: when i click to download it the page shows the message: "Error This template does not exist"
      • in the page attachments section, now the file is shown with size 0.
      • in tables, the related row is present in XWIKIATTACHMENT but no rows for XWIKIATTACHMENT_ARCHIVE and XWIKIATTACHMENT_CONTENT.

      note that files up to 50/60 MB can be uploaded without problems.

      Thanks
      claudio

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                calebjamesdelisle CalebJamesDeLisle
                Reporter:
                ccoreggioli Claudio Coreggioli
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Date of First Response: