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

Can't upgrade to 9.3 on MySQL

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Blocker
    • None
    • 9.3
    • Old Core
    • MySQL 5.7.17
    • Unknown

    Description

      Regression probably caused by XWIKI-14010.

      When upgrading from 9.2 to 9.3 on MySQL I end up with the following stack trace:

      com.xpn.xwiki.XWikiException: Error number 3202 in 3: Exception while reading document [xwiki:XWiki.XWikiPreferences]
      	at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:992)
      	at com.xpn.xwiki.store.XWikiCacheStore.loadXWikiDoc(XWikiCacheStore.java:280)
      	at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1817)
      	at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1870)
      	at org.xwiki.configuration.internal.AbstractXWikiPreferencesConfigurationSource.getBaseObject(AbstractXWikiPreferencesConfigurationSource.java:86)
      	at org.xwiki.configuration.internal.AbstractXWikiPreferencesConfigurationSource.getBaseProperty(AbstractXWikiPreferencesConfigurationSource.java:139)
      	at org.xwiki.configuration.internal.AbstractXWikiPreferencesConfigurationSource.getBaseProperty(AbstractXWikiPreferencesConfigurationSource.java:156)
      	at org.xwiki.configuration.internal.AbstractDocumentConfigurationSource.getPropertyValue(AbstractDocumentConfigurationSource.java:315)
      	at org.xwiki.configuration.internal.AbstractDocumentConfigurationSource.containsKey(AbstractDocumentConfigurationSource.java:194)
      	at org.xwiki.configuration.internal.AbstractCompositeConfigurationSource.containsKey(AbstractCompositeConfigurationSource.java:45)
      	at org.xwiki.configuration.internal.AbstractCompositeConfigurationSource.getProperty(AbstractCompositeConfigurationSource.java:95)
      	at org.xwiki.url.internal.DefaultURLConfiguration.getURLFormatId(DefaultURLConfiguration.java:55)
      	at org.xwiki.url.internal.URLExecutionContextInitializer.initialize(URLExecutionContextInitializer.java:55)
      	at org.xwiki.context.internal.DefaultExecutionContextManager.runInitializers(DefaultExecutionContextManager.java:115)
      	at org.xwiki.context.internal.DefaultExecutionContextManager.initialize(DefaultExecutionContextManager.java:103)
      	at org.xwiki.search.solr.internal.DefaultSolrIndexer.processBatch(DefaultSolrIndexer.java:408)
      	at org.xwiki.search.solr.internal.DefaultSolrIndexer.run(DefaultSolrIndexer.java:377)
      	at java.lang.Thread.run(Thread.java:748)
      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:769)
      	at com.xpn.xwiki.store.XWikiHibernateBaseStore.beginTransaction(XWikiHibernateBaseStore.java:942)
      	at com.xpn.xwiki.store.XWikiHibernateBaseStore.beginTransaction(XWikiHibernateBaseStore.java:873)
      	at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:865)
      	... 17 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 [90000] while the required version is [93000].
      	at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.preventAccessToOutdatedDb(AbstractDataMigrationManager.java:594)
      	at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.checkDatabase(AbstractDataMigrationManager.java:541)
      	at com.xpn.xwiki.store.XWikiHibernateBaseStore.setDatabase(XWikiHibernateBaseStore.java:765)
      	... 20 common frames omitted
      Caused by: com.xpn.xwiki.store.migration.DataMigrationException: Unable to update schema of wiki [xwiki]
      	at com.xpn.xwiki.store.migration.hibernate.HibernateDataMigrationManager.updateSchema(HibernateDataMigrationManager.java:182)
      	at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.migrateDatabase(AbstractDataMigrationManager.java:742)
      	at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.startMigrations(AbstractDataMigrationManager.java:664)
      	at com.xpn.xwiki.store.migration.hibernate.HibernateDataMigrationManager.startMigrations(HibernateDataMigrationManager.java:355)
      	at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.startMigrationsOnlyOnce(AbstractDataMigrationManager.java:644)
      	at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.tryToProcceedToMigration(AbstractDataMigrationManager.java:621)
      	at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.checkDatabase(AbstractDataMigrationManager.java:538)
      	at com.xpn.xwiki.store.XWikiHibernateBaseStore.setDatabase(XWikiHibernateBaseStore.java:765)
      	at com.xpn.xwiki.store.XWikiHibernateBaseStore.beginTransaction(XWikiHibernateBaseStore.java:942)
      	at com.xpn.xwiki.store.XWikiHibernateBaseStore.beginTransaction(XWikiHibernateBaseStore.java:873)
      	at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:865)
      	at com.xpn.xwiki.store.XWikiCacheStore.loadXWikiDoc(XWikiCacheStore.java:280)
      	at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1817)
      	at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1870)
      	at com.xpn.xwiki.XWiki.initializeMandatoryDocument(XWiki.java:1275)
      	at com.xpn.xwiki.XWiki.initializeMandatoryDocuments(XWiki.java:1249)
      	at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:1188)
      	at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:1103)
      	at com.xpn.xwiki.XWiki.<init>(XWiki.java:1076)
      	at com.xpn.xwiki.internal.XWikiInitializerJob.runInternal(XWikiInitializerJob.java:117)
      	at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:206)
      	at org.xwiki.job.AbstractJob.run(AbstractJob.java:189)
      	... 1 common frames omitted
      Caused by: org.hibernate.HibernateException: Failed updating schema while executing query [alter table activitystream_events_status add index FKBF7104E8CB8C5002 (ases_eventid), add constraint FKBF7104E8CB8C5002 foreign key (ases_eventid) references activitystream_events (ase_eventid)]
      	at com.xpn.xwiki.store.XWikiHibernateBaseStore.updateSchema(XWikiHibernateBaseStore.java:652)
      	at com.xpn.xwiki.store.XWikiHibernateBaseStore.updateSchema(XWikiHibernateBaseStore.java:393)
      	at com.xpn.xwiki.store.migration.hibernate.HibernateDataMigrationManager.hibernateShemaUpdate(HibernateDataMigrationManager.java:198)
      	at com.xpn.xwiki.store.migration.hibernate.HibernateDataMigrationManager.updateSchema(HibernateDataMigrationManager.java:179)
      	... 22 common frames omitted
      Caused by: java.sql.SQLException: Cannot add foreign key constraint
      	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964)
      	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3970)
      	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906)
      	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
      	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677)
      	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545)
      	at com.mysql.jdbc.StatementImpl.executeUpdateInternal(StatementImpl.java:1540)
      	at com.mysql.jdbc.StatementImpl.executeLargeUpdate(StatementImpl.java:2595)
      	at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1468)
      	at org.apache.commons.dbcp2.DelegatingStatement.executeUpdate(DelegatingStatement.java:234)
      	at org.apache.commons.dbcp2.DelegatingStatement.executeUpdate(DelegatingStatement.java:234)
      	at org.apache.commons.dbcp2.DelegatingStatement.executeUpdate(DelegatingStatement.java:234)
      	at com.xpn.xwiki.store.XWikiHibernateBaseStore.updateSchema(XWikiHibernateBaseStore.java:648)
      	... 25 common frames omitted
      

      Here is the content of the "LATEST FOREIGN KEY ERROR" section:

      2017-04-25 10:32:15 0x7f0a78506700 Error in foreign key constraint of table xwiki/#sql-553_25:
       foreign key (ases_eventid) references activitystream_events (ase_eventid):
      Cannot resolve table name close to:
       (ase_eventid)
      

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: