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

Import with history replacement produce a fails to find attachment file

    Details

    • Tests:
      Unit
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      To reproduce:

      • Use the standalone jetty/hsqldb distribution
      • Modify Sandbox.WebHome's content
      • Go to Admin UI > Content > Export
      • Click on "none" to remove all selection from the default filter
      • Click on Sandbox
      • Select history and backup options (haven't tried without so it's possible this doesn't have any effect)
      • Export
      • Go to Admin UI > Content > Import
      • Add the file exported in the previous step and click on it
      • Unselect the XWiki space (probably doesn't have any impact)
      • Select the "Replace the page history with the history from the package" option
      • Note that the backup option is selected since we exported as a backup pack
      • Click Import

      You'll see a page error and a stack trace in the logs:

      2019-12-15 17:31:31,527 [http://localhost:8080/xwiki/bin/import/XWiki/XWikiPreferences?editor=globaladmin&section=Import] ERROR c.x.x.w.ImportAction           - Failed to save document [xwiki:Sandbox.WebHome()] 
      com.xpn.xwiki.XWikiException: Error number 3232 in 3: Exception while saving deleted document content.
      	at org.xwiki.store.legacy.store.internal.FilesystemRecycleBinContentStore.save(FilesystemRecycleBinContentStore.java:88)
      	at com.xpn.xwiki.store.XWikiHibernateRecycleBinStore.lambda$saveToRecycleBin$0(XWikiHibernateRecycleBinStore.java:284)
      	at com.xpn.xwiki.store.XWikiHibernateBaseStore.execute(XWikiHibernateBaseStore.java:820)
      	at com.xpn.xwiki.store.XWikiHibernateBaseStore.executeWrite(XWikiHibernateBaseStore.java:935)
      	at com.xpn.xwiki.store.XWikiHibernateRecycleBinStore.saveToRecycleBin(XWikiHibernateRecycleBinStore.java:274)
      	at com.xpn.xwiki.XWiki.deleteDocument(XWiki.java:4522)
      	at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1994)
      	at com.xpn.xwiki.internal.filter.output.DocumentInstanceOutputFilterStream.maybeSaveDocument(DocumentInstanceOutputFilterStream.java:276)
      	at com.xpn.xwiki.internal.filter.output.DocumentInstanceOutputFilterStream.endWikiDocumentRevision(DocumentInstanceOutputFilterStream.java:174)
      	at sun.reflect.GeneratedMethodAccessor188.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.xwiki.filter.internal.FilterProxy.invoke(FilterProxy.java:90)
      	at org.xwiki.filter.internal.CompositeFilter.invoke(CompositeFilter.java:75)
      	at com.sun.proxy.$Proxy142.endWikiDocumentRevision(Unknown Source)
      	at sun.reflect.GeneratedMethodAccessor188.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.xwiki.filter.internal.FilterProxy.invoke(FilterProxy.java:90)
      	at org.xwiki.filter.internal.CompositeFilter.invoke(CompositeFilter.java:75)
      	at com.sun.proxy.$Proxy143.endWikiDocumentRevision(Unknown Source)
      	at sun.reflect.GeneratedMethodAccessor188.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.xwiki.filter.internal.FilterProxy.invoke(FilterProxy.java:90)
      	at org.xwiki.filter.internal.FilterProxy.invoke(FilterProxy.java:63)
      	at com.sun.proxy.$Proxy144.endWikiDocumentRevision(Unknown Source)
      	at org.xwiki.filter.xar.internal.input.DocumentLocaleReader.sendEndWikiDocumentRevision(DocumentLocaleReader.java:325)
      	at org.xwiki.filter.xar.internal.input.DocumentLocaleReader.sendEndWikiDocumentLocale(DocumentLocaleReader.java:298)
      	at org.xwiki.filter.xar.internal.input.DocumentLocaleReader.sendEndWikiDocument(DocumentLocaleReader.java:259)
      	at org.xwiki.filter.xar.internal.input.DocumentLocaleReader.readDocument(DocumentLocaleReader.java:513)
      	at org.xwiki.filter.xar.internal.input.DocumentLocaleReader.read(DocumentLocaleReader.java:392)
      	at org.xwiki.filter.xar.internal.input.DocumentLocaleReader.read(DocumentLocaleReader.java:347)
      	at org.xwiki.filter.xar.internal.input.WikiReader.read(WikiReader.java:135)
      	at org.xwiki.filter.xar.internal.input.WikiReader.read(WikiReader.java:95)
      	at org.xwiki.filter.xar.internal.input.XARInputFilterStream.readXAR(XARInputFilterStream.java:108)
      	at org.xwiki.filter.xar.internal.input.XARInputFilterStream.read(XARInputFilterStream.java:95)
      	at org.xwiki.filter.xar.internal.input.XARInputFilterStream.read(XARInputFilterStream.java:47)
      	at org.xwiki.filter.input.AbstractBeanInputFilterStream.read(AbstractBeanInputFilterStream.java:79)
      	at com.xpn.xwiki.web.ImportAction.importPackageFilterStream(ImportAction.java:319)
      	at com.xpn.xwiki.web.ImportAction.importPackage(ImportAction.java:137)
      	at com.xpn.xwiki.web.ImportAction.render(ImportAction.java:107)
      	at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:500)
      	at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:218)
      	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
      	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
      	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
      	at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      	at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(ServletHolder.java:1401)
      	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:760)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1617)
      	at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:112)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
      	at org.xwiki.wysiwyg.filter.ConversionFilter.doFilter(ConversionFilter.java:109)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
      	at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
      	at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
      	at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
      	at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:132)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1596)
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:545)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
      	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:536)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
      	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1592)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1296)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485)
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1562)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1211)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
      	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:221)
      	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
      	at org.eclipse.jetty.server.Server.handle(Server.java:500)
      	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:386)
      	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:562)
      	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:378)
      	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270)
      	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
      	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
      	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
      	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:388)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: org.xwiki.store.TransactionException: Failure in onRun()
      Caused by:
      com.xpn.xwiki.XWikiException
      	Error number 2002 in 2: Error parsing xml
      
      	at org.xwiki.store.TransactionRunnable.run(TransactionRunnable.java:333)
      	at org.xwiki.store.StartableTransactionRunnable.start(StartableTransactionRunnable.java:54)
      	at org.xwiki.store.legacy.store.internal.FilesystemRecycleBinContentStore.save(FilesystemRecycleBinContentStore.java:86)
      	... 97 common frames omitted
      Caused by: com.xpn.xwiki.XWikiException: Error number 2002 in 2: Error parsing xml
      	at com.xpn.xwiki.doc.XWikiDocument.toXML(XWikiDocument.java:4796)
      	at org.xwiki.store.legacy.store.internal.DeletedDocumentContentFileSerializer.serialize(DeletedDocumentContentFileSerializer.java:54)
      	at org.xwiki.store.FileSaveTransactionRunnable.onRun(FileSaveTransactionRunnable.java:156)
      	at org.xwiki.store.TransactionRunnable.run(TransactionRunnable.java:318)
      	... 99 common frames omitted
      Caused by: org.xwiki.store.UnexpectedException: Failed to get InputStream
      	at org.xwiki.store.legacy.doc.internal.FilesystemAttachmentContent.getContentInputStream(FilesystemAttachmentContent.java:121)
      	at com.xpn.xwiki.doc.XWikiAttachment.getContentInputStream(XWikiAttachment.java:889)
      	at com.xpn.xwiki.doc.XWikiAttachment.getContentInputStream(XWikiAttachment.java:884)
      	at com.xpn.xwiki.internal.filter.input.XWikiAttachmentEventGenerator.write(XWikiAttachmentEventGenerator.java:111)
      	at com.xpn.xwiki.internal.filter.input.XWikiDocumentLocaleEventGenerator.writeRevision(XWikiDocumentLocaleEventGenerator.java:204)
      	at com.xpn.xwiki.internal.filter.input.XWikiDocumentLocaleEventGenerator.write(XWikiDocumentLocaleEventGenerator.java:125)
      	at com.xpn.xwiki.internal.filter.input.XWikiDocumentLocaleEventGenerator.write(XWikiDocumentLocaleEventGenerator.java:56)
      	at org.xwiki.filter.instance.internal.input.AbstractBeanEntityEventGenerator.write(AbstractBeanEntityEventGenerator.java:131)
      	at com.xpn.xwiki.internal.filter.XWikiDocumentFilterUtils.exportEntity(XWikiDocumentFilterUtils.java:334)
      	at com.xpn.xwiki.doc.XWikiDocument.toXML(XWikiDocument.java:4793)
      	... 102 common frames omitted
      Caused by: java.io.FileNotFoundException: /Users/vmassol/dev/xwiki/versions/xwiki-platform-distribution-flavor-jetty-hsqldb-11.10.1/data/store/file/xwiki/8/3/927acf911df7547cf26345b2c3e89c/attachments/9/2/0bc685fa0da28168319c0126def81b/fv1.1.png (No such file or directory)
      	at java.io.FileInputStream.open0(Native Method)
      	at java.io.FileInputStream.open(FileInputStream.java:195)
      	at java.io.FileInputStream.<init>(FileInputStream.java:138)
      	at org.xwiki.store.legacy.doc.internal.FilesystemAttachmentContent.getContentInputStream(FilesystemAttachmentContent.java:119)
      	... 111 common frames omitted
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tmortagne Thomas Mortagne
                Reporter:
                vmassol Vincent Massol
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

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