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

Errors when importing document with history replacement

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 12.0-rc-1
    • Fix Version/s: 12.1-rc-1, 11.10.4
    • Component/s: Old Core
    • Labels:
    • Environment:
      Windows 10 Pro 64 bit, Edge 79, using a local instance XWiki 12.0
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      STEPS TO REPRODUCE

      1. Unzip a fresh XWiki 12.0 RC1 or 12.0 instance
      2. Modify Sandbox page's content
      3. Export the page with history (from Adminster Wiki > Content > Export)
      4. Go to Adminster Wiki > Content > Import
      5. Import the page with "Replace the page history with the history from the package" option

      or

      Unzip a fresh XWiki 12.0 RC1 or 12.0 instance and import the attached XAR file with "Replace the page history with the history from the package".

      EXPECTED RESULTS

      The page is imported successfully without any errors.

      ACTUAL RESULTS

      The page is not imported properly it seems, the attachment is not displayed properly in Attachments tab and in console there is the following stacktrace:

      2020-02-06 12:04:14,433 [http://localhost:1200/xwiki/bin/import/XWiki/XWikiPreferences?editor=globaladmin&section=Import] ERROR c.x.x.w.ImportAction           - Failed to send event [org.xwiki.bridge.event.DocumentUpdatedEvent@3f6d7d88] to listener [com.xpn.xwiki.internal.event.AttachmentEventGeneratorListener@2e9a591d] 
      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:911)
      	at com.xpn.xwiki.doc.XWikiAttachment.getContentInputStream(XWikiAttachment.java:906)
      	at com.xpn.xwiki.doc.XWikiDocument.retrieveDeletedAttachment(XWikiDocument.java:6768)
      	at com.xpn.xwiki.doc.XWikiDocument.getAttachmentDiff(XWikiDocument.java:6732)
      	at com.xpn.xwiki.internal.event.AttachmentEventGeneratorListener.onDocumentUpdatedEvent(AttachmentEventGeneratorListener.java:139)
      	at com.xpn.xwiki.internal.event.AttachmentEventGeneratorListener.onEvent(AttachmentEventGeneratorListener.java:88)
      	at org.xwiki.observation.internal.DefaultObservationManager.notify(DefaultObservationManager.java:320)
      	at org.xwiki.observation.internal.DefaultObservationManager.notify(DefaultObservationManager.java:285)
      	at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:2056)
      	at com.xpn.xwiki.internal.filter.output.DocumentInstanceOutputFilterStream.maybeSaveDocument(DocumentInstanceOutputFilterStream.java:247)
      	at com.xpn.xwiki.internal.filter.output.DocumentInstanceOutputFilterStream.endWikiDocumentRevision(DocumentInstanceOutputFilterStream.java:170)
      	at jdk.internal.reflect.GeneratedMethodAccessor190.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.xwiki.filter.internal.FilterProxy.invoke(FilterProxy.java:90)
      	at org.xwiki.filter.internal.CompositeFilter.invoke(CompositeFilter.java:75)
      	at com.sun.proxy.$Proxy130.endWikiDocumentRevision(Unknown Source)
      	at jdk.internal.reflect.GeneratedMethodAccessor190.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.xwiki.filter.internal.FilterProxy.invoke(FilterProxy.java:90)
      	at org.xwiki.filter.internal.CompositeFilter.invoke(CompositeFilter.java:75)
      	at com.sun.proxy.$Proxy131.endWikiDocumentRevision(Unknown Source)
      	at jdk.internal.reflect.GeneratedMethodAccessor190.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.xwiki.filter.internal.FilterProxy.invoke(FilterProxy.java:90)
      	at org.xwiki.filter.internal.FilterProxy.invoke(FilterProxy.java:63)
      	at com.sun.proxy.$Proxy132.endWikiDocumentRevision(Unknown Source)
      	at org.xwiki.filter.xar.internal.input.DocumentLocaleReader.sendEndWikiDocumentRevision(DocumentLocaleReader.java:326)
      	at org.xwiki.filter.xar.internal.input.DocumentLocaleReader.sendEndWikiDocumentLocale(DocumentLocaleReader.java:299)
      	at org.xwiki.filter.xar.internal.input.DocumentLocaleReader.sendEndWikiDocument(DocumentLocaleReader.java:260)
      	at org.xwiki.filter.xar.internal.input.DocumentLocaleReader.readDocument(DocumentLocaleReader.java:516)
      	at org.xwiki.filter.xar.internal.input.DocumentLocaleReader.read(DocumentLocaleReader.java:393)
      	at org.xwiki.filter.xar.internal.input.DocumentLocaleReader.read(DocumentLocaleReader.java:348)
      	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:109)
      	at org.xwiki.filter.xar.internal.input.XARInputFilterStream.read(XARInputFilterStream.java:87)
      	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:560)
      	at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:250)
      	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.base/java.lang.Thread.run(Thread.java:834)
      Caused by: java.io.FileNotFoundException: C:\ILIE LUCRU\XWIKI 12.0\xwiki-platform-distribution-flavor-jetty-hsqldb-12.0 STD\data\store\file\xwiki\8\3\927acf911df7547cf26345b2c3e89c\attachments\9\2\0bc685fa0da28168319c0126def81b\f.png (The system cannot find the file specified)
      	at java.base/java.io.FileInputStream.open0(Native Method)
      	at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
      	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
      	at org.xwiki.store.legacy.doc.internal.FilesystemAttachmentContent.getContentInputStream(FilesystemAttachmentContent.java:119)
      	... 100 common frames omitted
      2020-02-06 12:04:14,458 [XWiki Solr index thread] ERROR .DocumentSolrMetadataExtractor - Failed to retrieve the content of attachment [Attachment xwiki:Sandbox.WebHome@XWikiLogo.png] 
      com.xpn.xwiki.XWikiException: Error number 3002 in 3: The attachment [Attachment xwiki:Sandbox.WebHome@XWikiLogo.png] (file C:\ILIE LUCRU\XWIKI 12.0\xwiki-platform-distribution-flavor-jetty-hsqldb-12.0 STD\data\store\file\xwiki\8\3\927acf911df7547cf26345b2c3e89c\attachments\9\2\0bc685fa0da28168319c0126def81b\f.png) could not be found in the filesystem attachment store.
      	at org.xwiki.store.legacy.store.internal.FilesystemAttachmentStore.loadAttachmentContent(FilesystemAttachmentStore.java:214)
      	at com.xpn.xwiki.doc.XWikiAttachment.loadAttachmentContent(XWikiAttachment.java:1095)
      	at com.xpn.xwiki.doc.XWikiAttachment.reloadAttachmentContent(XWikiAttachment.java:918)
      	at com.xpn.xwiki.doc.XWikiAttachment.getContentInputStream(XWikiAttachment.java:896)
      	at org.xwiki.search.solr.internal.metadata.AbstractSolrMetadataExtractor.getContentAsText(AbstractSolrMetadataExtractor.java:506)
      	at org.xwiki.search.solr.internal.metadata.DocumentSolrMetadataExtractor.setAttachment(DocumentSolrMetadataExtractor.java:281)
      	at org.xwiki.search.solr.internal.metadata.DocumentSolrMetadataExtractor.setAttachments(DocumentSolrMetadataExtractor.java:261)
      	at org.xwiki.search.solr.internal.metadata.DocumentSolrMetadataExtractor.setExtras(DocumentSolrMetadataExtractor.java:187)
      	at org.xwiki.search.solr.internal.metadata.DocumentSolrMetadataExtractor.setFieldsInternal(DocumentSolrMetadataExtractor.java:135)
      	at org.xwiki.search.solr.internal.metadata.AbstractSolrMetadataExtractor.getSolrDocument(AbstractSolrMetadataExtractor.java:133)
      	at org.xwiki.search.solr.internal.DefaultSolrIndexer.getSolrDocument(DefaultSolrIndexer.java:504)
      	at org.xwiki.search.solr.internal.DefaultSolrIndexer.processBatch(DefaultSolrIndexer.java:411)
      	at org.xwiki.search.solr.internal.DefaultSolrIndexer.run(DefaultSolrIndexer.java:377)
      	at java.base/java.lang.Thread.run(Thread.java:834)
      2020-02-06 12:04:14,618 [XWiki Solr index thread] ERROR .DocumentSolrMetadataExtractor - Failed to retrieve the content of attachment [Attachment xwiki:Sandbox.WebHome@XWikiLogo.png] 
      com.xpn.xwiki.XWikiException: Error number 3002 in 3: The attachment [Attachment xwiki:Sandbox.WebHome@XWikiLogo.png] (file C:\ILIE LUCRU\XWIKI 12.0\xwiki-platform-distribution-flavor-jetty-hsqldb-12.0 STD\data\store\file\xwiki\8\3\927acf911df7547cf26345b2c3e89c\attachments\9\2\0bc685fa0da28168319c0126def81b\f.png) could not be found in the filesystem attachment store.
      	at org.xwiki.store.legacy.store.internal.FilesystemAttachmentStore.loadAttachmentContent(FilesystemAttachmentStore.java:214)
      	at com.xpn.xwiki.doc.XWikiAttachment.loadAttachmentContent(XWikiAttachment.java:1095)
      	at com.xpn.xwiki.doc.XWikiAttachment.reloadAttachmentContent(XWikiAttachment.java:918)
      	at com.xpn.xwiki.doc.XWikiAttachment.getContentInputStream(XWikiAttachment.java:896)
      	at org.xwiki.search.solr.internal.metadata.AbstractSolrMetadataExtractor.getContentAsText(AbstractSolrMetadataExtractor.java:506)
      	at org.xwiki.search.solr.internal.metadata.DocumentSolrMetadataExtractor.setAttachment(DocumentSolrMetadataExtractor.java:281)
      	at org.xwiki.search.solr.internal.metadata.DocumentSolrMetadataExtractor.setAttachments(DocumentSolrMetadataExtractor.java:261)
      	at org.xwiki.search.solr.internal.metadata.DocumentSolrMetadataExtractor.setExtras(DocumentSolrMetadataExtractor.java:187)
      	at org.xwiki.search.solr.internal.metadata.DocumentSolrMetadataExtractor.setFieldsInternal(DocumentSolrMetadataExtractor.java:135)
      	at org.xwiki.search.solr.internal.metadata.AbstractSolrMetadataExtractor.getSolrDocument(AbstractSolrMetadataExtractor.java:133)
      	at org.xwiki.search.solr.internal.DefaultSolrIndexer.getSolrDocument(DefaultSolrIndexer.java:504)
      	at org.xwiki.search.solr.internal.DefaultSolrIndexer.processBatch(DefaultSolrIndexer.java:411)
      	at org.xwiki.search.solr.internal.DefaultSolrIndexer.run(DefaultSolrIndexer.java:377)
      	at java.base/java.lang.Thread.run(Thread.java:834)
      2020-02-06 12:04:14,631 [XWiki Solr index thread] ERROR .DocumentSolrMetadataExtractor - Failed to retrieve the content of attachment [Attachment xwiki:Sandbox.WebHome@XWikiLogo.png] 
      com.xpn.xwiki.XWikiException: Error number 3002 in 3: The attachment [Attachment xwiki:Sandbox.WebHome@XWikiLogo.png] (file C:\ILIE LUCRU\XWIKI 12.0\xwiki-platform-distribution-flavor-jetty-hsqldb-12.0 STD\data\store\file\xwiki\8\3\927acf911df7547cf26345b2c3e89c\attachments\9\2\0bc685fa0da28168319c0126def81b\f.png) could not be found in the filesystem attachment store.
      	at org.xwiki.store.legacy.store.internal.FilesystemAttachmentStore.loadAttachmentContent(FilesystemAttachmentStore.java:214)
      	at com.xpn.xwiki.doc.XWikiAttachment.loadAttachmentContent(XWikiAttachment.java:1095)
      	at com.xpn.xwiki.doc.XWikiAttachment.reloadAttachmentContent(XWikiAttachment.java:918)
      	at com.xpn.xwiki.doc.XWikiAttachment.getContentInputStream(XWikiAttachment.java:896)
      	at org.xwiki.search.solr.internal.metadata.AbstractSolrMetadataExtractor.getContentAsText(AbstractSolrMetadataExtractor.java:506)
      	at org.xwiki.search.solr.internal.metadata.DocumentSolrMetadataExtractor.setAttachment(DocumentSolrMetadataExtractor.java:281)
      	at org.xwiki.search.solr.internal.metadata.DocumentSolrMetadataExtractor.setAttachments(DocumentSolrMetadataExtractor.java:261)
      	at org.xwiki.search.solr.internal.metadata.DocumentSolrMetadataExtractor.setExtras(DocumentSolrMetadataExtractor.java:187)
      	at org.xwiki.search.solr.internal.metadata.DocumentSolrMetadataExtractor.setFieldsInternal(DocumentSolrMetadataExtractor.java:135)
      	at org.xwiki.search.solr.internal.metadata.AbstractSolrMetadataExtractor.getSolrDocument(AbstractSolrMetadataExtractor.java:133)
      	at org.xwiki.search.solr.internal.DefaultSolrIndexer.getSolrDocument(DefaultSolrIndexer.java:504)
      	at org.xwiki.search.solr.internal.DefaultSolrIndexer.processBatch(DefaultSolrIndexer.java:411)
      	at org.xwiki.search.solr.internal.DefaultSolrIndexer.run(DefaultSolrIndexer.java:377)
      	at java.base/java.lang.Thread.run(Thread.java:834)
      2020-02-06 12:04:14,776 [XWiki Solr index thread] ERROR .DocumentSolrMetadataExtractor - Failed to retrieve the content of attachment [Attachment xwiki:Sandbox.WebHome@XWikiLogo.png] 
      com.xpn.xwiki.XWikiException: Error number 3002 in 3: The attachment [Attachment xwiki:Sandbox.WebHome@XWikiLogo.png] (file C:\ILIE LUCRU\XWIKI 12.0\xwiki-platform-distribution-flavor-jetty-hsqldb-12.0 STD\data\store\file\xwiki\8\3\927acf911df7547cf26345b2c3e89c\attachments\9\2\0bc685fa0da28168319c0126def81b\f.png) could not be found in the filesystem attachment store.
      	at org.xwiki.store.legacy.store.internal.FilesystemAttachmentStore.loadAttachmentContent(FilesystemAttachmentStore.java:214)
      	at com.xpn.xwiki.doc.XWikiAttachment.loadAttachmentContent(XWikiAttachment.java:1095)
      	at com.xpn.xwiki.doc.XWikiAttachment.reloadAttachmentContent(XWikiAttachment.java:918)
      	at com.xpn.xwiki.doc.XWikiAttachment.getContentInputStream(XWikiAttachment.java:896)
      	at org.xwiki.search.solr.internal.metadata.AbstractSolrMetadataExtractor.getContentAsText(AbstractSolrMetadataExtractor.java:506)
      	at org.xwiki.search.solr.internal.metadata.DocumentSolrMetadataExtractor.setAttachment(DocumentSolrMetadataExtractor.java:281)
      	at org.xwiki.search.solr.internal.metadata.DocumentSolrMetadataExtractor.setAttachments(DocumentSolrMetadataExtractor.java:261)
      	at org.xwiki.search.solr.internal.metadata.DocumentSolrMetadataExtractor.setExtras(DocumentSolrMetadataExtractor.java:187)
      	at org.xwiki.search.solr.internal.metadata.DocumentSolrMetadataExtractor.setFieldsInternal(DocumentSolrMetadataExtractor.java:135)
      	at org.xwiki.search.solr.internal.metadata.AbstractSolrMetadataExtractor.getSolrDocument(AbstractSolrMetadataExtractor.java:133)
      	at org.xwiki.search.solr.internal.DefaultSolrIndexer.getSolrDocument(DefaultSolrIndexer.java:504)
      	at org.xwiki.search.solr.internal.DefaultSolrIndexer.processBatch(DefaultSolrIndexer.java:411)
      	at org.xwiki.search.solr.internal.DefaultSolrIndexer.run(DefaultSolrIndexer.java:377)
      	at java.base/java.lang.Thread.run(Thread.java:834)
      

      I've also attached the full logs from XWiki 12.0.

      The issue could not be reproduced on XWiki 11.10.3.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tmortagne Thomas Mortagne
                Reporter:
                iandriuta Ilie Andriuta
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

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