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

SQL errors when upgrading XWiki from pre 14.x to 14.4.1

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • 14.4.2, 14.5
    • 14.4.1
    • None
    • Windows 11 Pro 64 bit,Edge 102, using a local instance of XWiki 14.4.1 on MySQL 8, Tomcat 9.0.64, reproducible also on Jetty/HSQL
    • Unit
    • Unknown
    • N/A
    • N/A

    Description

      STEPS TO REPRODUCE

      1. Create an instance of XWiki older than 14.x (tested with 13.10.6, 12.10.11, 11.10.13, 10.11.11, 9.11.8 and 8.4.6)
      2. Close the instance
      3. Go to the newer instance (14.4.1) and copy/cut the
        [...]webapps\xwiki 

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

      4. Start XWiki
      5. Access the instance in browser and observe the console

      EXPECTED RESULTS

      No errors are encountered.

      ACTUAL RESULTS

      In XWiki console, there is the following stacktrace displayed (please find attached below full logs from Tomcat 9.0.64 and Jetty/HSQL standard package) : 

      2022-06-17 16:24:18,990 [XWiki initialization] WARN  o.h.e.j.s.SqlExceptionHelper   - SQL Error: 1054, SQLState: 42S22
      2022-06-17 16:24:18,990 [XWiki initialization] ERROR o.h.e.j.s.SqlExceptionHelper   - Unknown column 'xwikidocum0_.XWD_ORIGINAL_METADATA_AUTHOR' in 'field list'
      2022-06-17 16:24:18,995 [XWiki initialization] ERROR PreferencesConfigurationSource - Failed to access configuration value for property [eventstream.usemainstore]. Ignoring by returning null
      com.xpn.xwiki.XWikiException: Error number 3202 in 3: Exception while reading document [xwiki:Main.WebPreferences()]
              at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:1157)
              at com.xpn.xwiki.store.XWikiCacheStore.loadXWikiDoc(XWikiCacheStore.java:395)
              at com.xpn.xwiki.XWiki.getDocument(XWiki.java:2164)
              at com.xpn.xwiki.XWiki.getDocument(XWiki.java:2226)
              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:348)
              at org.xwiki.configuration.internal.AbstractDocumentConfigurationSource.containsKey(AbstractDocumentConfigurationSource.java:203)
              at org.xwiki.configuration.internal.AbstractSpacesConfigurationSource$SpaceConfigurationSource.containsKey(AbstractSpacesConfigurationSource.java:171)
              at org.xwiki.configuration.internal.AbstractCompositeConfigurationSource.containsKey(AbstractCompositeConfigurationSource.java:45)
              at org.xwiki.configuration.internal.AbstractCompositeConfigurationSource.containsKey(AbstractCompositeConfigurationSource.java:45)
              at org.xwiki.configuration.internal.AbstractCompositeConfigurationSource.getProperty(AbstractCompositeConfigurationSource.java:95)
              at org.xwiki.notifications.filters.internal.NotificationFilterPreferenceConfiguration.getProperty(NotificationFilterPreferenceConfiguration.java:80)
              at org.xwiki.notifications.filters.internal.NotificationFilterPreferenceConfiguration.useMainStore(NotificationFilterPreferenceConfiguration.java:75)
              at org.xwiki.notifications.filters.migration.R140401000XWIKI15460DataMigration.shouldExecute(R140401000XWIKI15460DataMigration.java:114)
              at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.getNeededMigrations(AbstractDataMigrationManager.java:764)
              at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.migrateDatabase(AbstractDataMigrationManager.java:734)
              at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.startMigrations(AbstractDataMigrationManager.java:657)
              at com.xpn.xwiki.store.migration.hibernate.HibernateDataMigrationManager.startMigrations(HibernateDataMigrationManager.java:357)
              at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.startMigrationsOnlyOnce(AbstractDataMigrationManager.java:637)
              at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.tryToProcceedToMigration(AbstractDataMigrationManager.java:614)
              at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.checkDatabase(AbstractDataMigrationManager.java:539)
              at com.xpn.xwiki.internal.store.hibernate.HibernateStore.setWiki(HibernateStore.java:703)
              at com.xpn.xwiki.internal.store.hibernate.HibernateStore.setWiki(HibernateStore.java:662)
              at com.xpn.xwiki.internal.store.hibernate.HibernateStore.beginTransaction(HibernateStore.java:853)
              at com.xpn.xwiki.store.XWikiHibernateBaseStore.beginTransaction(XWikiHibernateBaseStore.java:576)
              at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:1024)
              at com.xpn.xwiki.store.XWikiCacheStore.loadXWikiDoc(XWikiCacheStore.java:395)
              at com.xpn.xwiki.XWiki.getDocument(XWiki.java:2164)
              at com.xpn.xwiki.XWiki.getDocument(XWiki.java:2226)
              at com.xpn.xwiki.XWiki.initializeMandatoryDocument(XWiki.java:1439)
              at com.xpn.xwiki.XWiki.initializeMandatoryDocuments(XWiki.java:1406)
              at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:1315)
              at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:1252)
              at com.xpn.xwiki.XWiki.<init>(XWiki.java:1225)
              at com.xpn.xwiki.internal.XWikiInitializerJob.runInternal(XWikiInitializerJob.java:117)
              at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:243)
              at org.xwiki.job.AbstractJob.run(AbstractJob.java:220)
              at java.base/java.lang.Thread.run(Thread.java:833)
      Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
              at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:63)
              at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:37)
              at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113)
              at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99)
              at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:67)
              at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.getResultSet(AbstractLoadPlanBasedLoader.java:390)
              at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeQueryStatement(AbstractLoadPlanBasedLoader.java:163)
              at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeLoad(AbstractLoadPlanBasedLoader.java:104)
              at org.hibernate.loader.entity.plan.AbstractLoadPlanBasedEntityLoader.load(AbstractLoadPlanBasedEntityLoader.java:285)
              at org.hibernate.persister.entity.AbstractEntityPersister.doLoad(AbstractEntityPersister.java:4521)
              at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:4511)
              at org.hibernate.event.internal.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:571)
              at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:539)
              at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:208)
              at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:327)
              at org.hibernate.event.internal.DefaultLoadEventListener.doOnLoad(DefaultLoadEventListener.java:108)
              at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:74)
              at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:118)
              at org.hibernate.internal.SessionImpl.fireLoadNoChecks(SessionImpl.java:1231)
              at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1220)
              at org.hibernate.internal.SessionImpl.access$2100(SessionImpl.java:202)
              at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.doLoad(SessionImpl.java:2835)
              at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.lambda$load$1(SessionImpl.java:2812)
              at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.perform(SessionImpl.java:2768)
              at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.load(SessionImpl.java:2812)
              at org.hibernate.internal.SessionImpl.get(SessionImpl.java:1019)
              at org.hibernate.engine.spi.SessionDelegatorBaseImpl.get(SessionDelegatorBaseImpl.java:1000)
              at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:1028)
              ... 39 common frames omitted
      Caused by: java.sql.SQLSyntaxErrorException: Unknown column 'xwikidocum0_.XWD_ORIGINAL_METADATA_AUTHOR' in 'field list'
              at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
              at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
              at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
              at com.mysql.cj.jdbc.ClientPreparedStatement.executeQuery(ClientPreparedStatement.java:1009)
              at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:122)
              at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:122)
              at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:122)
              at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:57)
              ... 62 common frames omitted

      However, the DW is reached in the browser.

      The issue could not be reproduced when upgrading to XWiki 13.10.6 and 14.4.

      Attachments

        Activity

          People

            mleduc Manuel Leduc
            iandriuta Ilie Andriuta
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: