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

Migration fails from 4.5.2 to 6.2M2 with File System Attachments enabled

    XMLWordPrintable

Details

    • Unknown
    • N/A
    • N/A

    Description

      The FileSystem Attachment store triggers the data migrations during its own initialization, before XWiki object is ready, and so any migration that need this object or other store than the main store to modify documents might fail.

      Actually, we have the problem in WikiTemplateMigration#hibernateMigrate() when it performs xwiki.saveDocument().

      2014-08-27 22:34:48,531 [XWiki initialization] ERROR c.x.x.i.XWikiInitializerJob    - Exception thrown during job execution.
      com.xpn.xwiki.XWikiException: Error number 3202 in 3: Exception while reading document [xwiki:XWiki.SchedulerJobClass]
              at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:958) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.store.XWikiCacheStore.loadXWikiDoc(XWikiCacheStore.java:291) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1292) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1340) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.XWiki.initializeMandatoryClasses(XWiki.java:766) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:726) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:651) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.XWiki.<init>(XWiki.java:640) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.internal.XWikiInitializerJob.runInternal(XWikiInitializerJob.java:115) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at org.xwiki.job.internal.AbstractJob.runInContext(AbstractJob.java:209) [xwiki-commons-job-6.2-milestone-2.jar:na]
              at org.xwiki.job.internal.AbstractJob.run(AbstractJob.java:192) [xwiki-commons-job-6.2-milestone-2.jar:na]
              at java.lang.Thread.run(Thread.java:744) [na:1.7.0_51]
      Caused by: com.xpn.xwiki.XWikiException: Error number 3301 in 3: Exception while switching to database xwiki
              at com.xpn.xwiki.store.XWikiHibernateBaseStore.setDatabase(XWikiHibernateBaseStore.java:739) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.store.XWikiHibernateBaseStore.beginTransaction(XWikiHibernateBaseStore.java:911) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.store.XWikiHibernateBaseStore.beginTransaction(XWikiHibernateBaseStore.java:843) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:830) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              ... 11 common frames omitted
      Caused by: com.xpn.xwiki.store.migration.DataMigrationException: Migration of database [xwiki] has failed, it could not be safely used! Database is currently in version [53000] while the required version is [54300].
              at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.preventAccessToOutdatedDb(AbstractDataMigrationManager.java:578) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.checkDatabase(AbstractDataMigrationManager.java:525) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.store.XWikiHibernateBaseStore.setDatabase(XWikiHibernateBaseStore.java:735) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              ... 14 common frames omitted
      Caused by: com.xpn.xwiki.store.migration.DataMigrationException: Data migration R54000WikiTemplateMigration failed
              at com.xpn.xwiki.store.migration.hibernate.AbstractHibernateDataMigration.migrate(AbstractHibernateDataMigration.java:111) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.startMigrations(AbstractDataMigrationManager.java:818) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.migrateDatabase(AbstractDataMigrationManager.java:717) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.startMigrations(AbstractDataMigrationManager.java:643) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.store.migration.hibernate.HibernateDataMigrationManager.startMigrations(HibernateDataMigrationManager.java:349) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.startMigrationsOnlyOnce(AbstractDataMigrationManager.java:628) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.tryToProcceedToMigration(AbstractDataMigrationManager.java:605) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.checkDatabase(AbstractDataMigrationManager.java:522) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.store.XWikiHibernateBaseStore.setDatabase(XWikiHibernateBaseStore.java:735) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.store.XWikiHibernateBaseStore.beginTransaction(XWikiHibernateBaseStore.java:911) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.store.XWikiHibernateBaseStore.beginTransaction(XWikiHibernateBaseStore.java:843) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:830) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.store.XWikiCacheStore.loadXWikiDoc(XWikiCacheStore.java:291) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1292) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1340) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.doc.DefaultDocumentAccessBridge.getProperty(DefaultDocumentAccessBridge.java:353) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at org.xwiki.configuration.internal.AbstractDocumentConfigurationSource.getPropertyObject(AbstractDocumentConfigurationSource.java:146) ~[xwiki-platform-configuration-default-6.2-milestone-2.jar:na]
              at org.xwiki.configuration.internal.AbstractDocumentConfigurationSource.containsKey(AbstractDocumentConfigurationSource.java:94) ~[xwiki-platform-configuration-default-6.2-milestone-2.jar:na]
              at org.xwiki.configuration.internal.CompositeConfigurationSource.containsKey(CompositeConfigurationSource.java:54) ~[xwiki-platform-configuration-default-6.2-milestone-2.jar:na]
              at org.xwiki.configuration.internal.CompositeConfigurationSource.getProperty(CompositeConfigurationSource.java:104) ~[xwiki-platform-configuration-default-6.2-milestone-2.jar:na]
              at org.xwiki.store.filesystem.internal.DefaultFilesystemAttachmentsConfiguration.cleanOnStartup(DefaultFilesystemAttachmentsConfiguration.java:52) ~[xwiki-platform-store-filesystem-attachments-6.2-milestone-2.jar:na]
              at org.xwiki.store.filesystem.internal.DefaultFilesystemStoreTools.initialize(DefaultFilesystemStoreTools.java:162) ~[xwiki-platform-store-filesystem-attachments-6.2-milestone-2.jar:na]
              at org.xwiki.component.embed.InitializableLifecycleHandler.handle(InitializableLifecycleHandler.java:39) ~[xwiki-commons-legacy-component-default-6.2-milestone-2.jar:na]
              at org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:323) ~[xwiki-commons-legacy-component-default-6.2-milestone-2.jar:na]
              at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:378) ~[xwiki-commons-legacy-component-default-6.2-milestone-2.jar:na]
              at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:346) ~[xwiki-commons-legacy-component-default-6.2-milestone-2.jar:na]
              at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:160) ~[xwiki-commons-legacy-component-default-6.2-milestone-2.jar:na]
              at org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:312) ~[xwiki-commons-legacy-component-default-6.2-milestone-2.jar:na]
              at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:378) ~[xwiki-commons-legacy-component-default-6.2-milestone-2.jar:na]
              at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:346) ~[xwiki-commons-legacy-component-default-6.2-milestone-2.jar:na]
              at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:160) ~[xwiki-commons-legacy-component-default-6.2-milestone-2.jar:na]
              at org.xwiki.component.internal.multi.DelegateComponentManager.getInstance(DelegateComponentManager.java:83) ~[xwiki-commons-legacy-component-api-6.2-milestone-2.jar:na]
              at org.xwiki.component.internal.multi.DelegateComponentManager.getInstance(DelegateComponentManager.java:83) ~[xwiki-commons-legacy-component-api-6.2-milestone-2.jar:na]
              at org.xwiki.component.internal.multi.DelegateComponentManager.getInstance(DelegateComponentManager.java:83) ~[xwiki-commons-legacy-component-api-6.2-milestone-2.jar:na]
              at org.xwiki.component.internal.multi.DelegateComponentManager.getInstance(DelegateComponentManager.java:83) ~[xwiki-commons-legacy-component-api-6.2-milestone-2.jar:na]
              at org.xwiki.component.internal.multi.DelegateComponentManager.getInstance(DelegateComponentManager.java:83) ~[xwiki-commons-legacy-component-api-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.web.Utils.getComponent(Utils.java:745) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:694) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              ... 6 common frames omitted
      Caused by: com.xpn.xwiki.store.migration.DataMigrationException: Failed to upgrade a wiki descriptor.
              at org.xwiki.wiki.template.internal.migration.WikiTemplateMigration.hibernateMigrate(WikiTemplateMigration.java:132) ~[xwiki-platform-wiki-template-default-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.store.migration.hibernate.AbstractHibernateDataMigration.migrate(AbstractHibernateDataMigration.java:109) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              ... 43 common frames omitted
      Caused by: com.xpn.xwiki.XWikiException: Error number 3201 in 3: Exception while saving document xwiki:XWiki.XWikiServerClassTemplate
              at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:780) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:178) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:171) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1241) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1185) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              at org.xwiki.wiki.template.internal.migration.WikiTemplateMigration.hibernateMigrate(WikiTemplateMigration.java:127) ~[xwiki-platform-wiki-template-default-6.2-milestone-2.jar:na]
              ... 44 common frames omitted
      Caused by: java.lang.NullPointerException: null
              at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:557) ~[xwiki-platform-legacy-oldcore-6.2-milestone-2.jar:na]
              ... 49 common frames omitted
      

      Attachments

        Activity

          People

            softec Denis Gervalle
            gdelhumeau Guillaume Delhumeau
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: