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

Failed to retrieve the content of attachment errors for subwiki when upgrading from XWiki 8.4.6 to XWiki 11.1 on FileSystem

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • 11.2-rc-1
    • 11.0.3, 11.1
    • Storage - File System
    • Windows 10 Pro 64 bit, Chrome 72, IE11, Edge 18, Firefox 65, using a local instance XWiki 11.1
    • Integration
    • Unknown
    • N/A
    • N/A

    Description

      STEPS TO REPRODUCE

      1. Create an older instance of XWiki (8.4.6) with FileSystem enabled for attachments:
        xwiki.store.attachment.hint=file
        xwiki.store.attachment.versioning.hint=file
        xwiki.store.attachment.recyclebin.hint=file
      1. Login to the older instance
      2. Create a new subwiki
      3. Close the instance
      4. Go to a newer instance (11.1) and copy/cut the
        [...]webapps\xwiki

        folder and replace it (first delete the old one) in the same location on the older version

      5. Start XWiki and follow the Distribution Wizard through the upgrade process
      6. Go to Wiki Index and click on the previously created subwiki's name to run the DW

      EXPECTED RESULTS

      The upgrade process is completed successfully without errors both on the Main wiki, as well as on subwiki.

      ACTUAL RESULTS

      During XWiki initialization, before starting DW for Main Wiki, there are many errors starting to display in console related to fail retrieving the content of attachments for the subwiki. Partial stacktrace:

      2019-03-04 11:44:41,361 [XWiki Solr index thread] ERROR .DocumentSolrMetadataExtractor - Failed to retrieve the content of attachment [Attachment subwikiglobal:Sandbox.WebHome@XWikiLogo.png] 
      com.xpn.xwiki.XWikiException: Error number 3231 in 3: Exception while loading attachment Attachment subwikiglobal:Sandbox.WebHome@XWikiLogo.png
      	at com.xpn.xwiki.store.XWikiHibernateAttachmentStore.loadAttachmentContent(XWikiHibernateAttachmentStore.java:260)
      	at com.xpn.xwiki.doc.XWikiAttachment.loadAttachmentContent(XWikiAttachment.java:1073)
      	at com.xpn.xwiki.doc.XWikiAttachment.reloadAttachmentContent(XWikiAttachment.java:893)
      	at com.xpn.xwiki.doc.XWikiAttachment.getContentInputStream(XWikiAttachment.java:871)
      	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.lang.Thread.run(Unknown Source)
      Caused by: org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.xpn.xwiki.doc.XWikiAttachmentContent#-2096787253]
      	at org.hibernate.impl.SessionFactoryImpl$2.handleEntityNotFound(SessionFactoryImpl.java:435)
      	at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:233)
      	at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:285)
      	at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:152)
      	at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1090)
      	at org.hibernate.impl.SessionImpl.load(SessionImpl.java:974)
      	at com.xpn.xwiki.store.XWikiHibernateAttachmentStore.loadAttachmentContent(XWikiHibernateAttachmentStore.java:247)
      	... 13 common frames omitted

      The full log (from MySQL) was attached.

      Also, during subwiki's DW the same errors keep displaying; additionally, there are some merge conflicts on pages 'Panels.SyntaxHelp' and 'Invitation.WebHome' which seem to have the same cause (screenshots attached). After upgrade, attachments from these 2 pages are displayed in 'Deleted Attachments' livetable on Main Wiki's Page Index.

      The issue was reproduced on HSQL, MySQL, PostgreSQL and Oracle.

      Attachments

        1. 2019_03_04.output MySQL FS.log
          468 kB
          Ilie Andriuta
        2. Invitation_PanelsSyntax_attach_deleted_on_Main.jpg
          132 kB
          Ilie Andriuta
        3. Invitation.WebHome.jpg
          202 kB
          Ilie Andriuta
        4. Panels.SyntaxHelp1.jpg
          244 kB
          Ilie Andriuta
        5. Panels.SyntaxHelp2.jpg
          195 kB
          Ilie Andriuta

        Activity

          People

            tmortagne Thomas Mortagne
            iandriuta Ilie Andriuta
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: