Help Migration DB from 150700001 to 151002000

Hi,
I tried to upgrade my Debian 11.8 and got new xwiki packages this morning – but the upgrade fails in R151002000XWIKI21448DataMigration.internalHibernateMigrate() with “Error when performing the query to access filters”. Database is currently not useable anymore.

Installed Debian packages:

  • xwiki-common (15.10.2)
  • xwiki-pgsql-common (15.10.2)
  • xwiki-tomcat9-common (15.10.2)
  • xwiki-tomcat9-pgsql (15.10.2)
  • openjdk-11-jre-headless:amd64 (11.0.20+8-1~deb11u1)
  • postgresql-13 (13.11-0+deb11u1)

Log from catalina.out:
[2023-12-27 15:11:00] [info] #011at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.startMigrations(AbstractDataMigrationManager.java:657)
[2023-12-27 15:11:00] [info] #011at com.xpn.xwiki.store.migration.hibernate.HibernateDataMigrationManager.startMigrations(HibernateDataMigrationManager.java:363)
[2023-12-27 15:11:00] [info] #011at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.startMigrationsOnlyOnce(AbstractDataMigrationManager.java:637)
[2023-12-27 15:11:00] [info] #011at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.tryToProcceedToMigration(AbstractDataMigrationManager.java:614)
[2023-12-27 15:11:00] [info] #011at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.checkDatabase(AbstractDataMigrationManager.java:539)
[2023-12-27 15:11:00] [info] #011at com.xpn.xwiki.internal.store.hibernate.HibernateStore.beginTransaction(HibernateStore.java:867)
[2023-12-27 15:11:00] [info] #011at com.xpn.xwiki.store.XWikiHibernateBaseStore.beginTransaction(XWikiHibernateBaseStore.java:576)
[2023-12-27 15:11:00] [info] #011at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:1040)
[2023-12-27 15:11:00] [info] #011at com.xpn.xwiki.store.XWikiCacheStore.loadXWikiDoc(XWikiCacheStore.java:399)
[2023-12-27 15:11:00] [info] #011at com.xpn.xwiki.XWiki.getDocument(XWiki.java:2196)
[2023-12-27 15:11:00] [info] #011at com.xpn.xwiki.XWiki.getDocument(XWiki.java:2258)
[2023-12-27 15:11:00] [info] #011at com.xpn.xwiki.XWiki.initializeMandatoryDocument(XWiki.java:1459)
[2023-12-27 15:11:00] [info] #011at com.xpn.xwiki.XWiki.initializeMandatoryDocuments(XWiki.java:1426)
[2023-12-27 15:11:00] [info] #011at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:1354)
[2023-12-27 15:11:00] [info] #011at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:1291)
[2023-12-27 15:11:00] [info] #011at com.xpn.xwiki.XWiki.(XWiki.java:1264)
[2023-12-27 15:11:00] [info] #011at com.xpn.xwiki.internal.XWikiInitializerJob.runInternal(XWikiInitializerJob.java:103)
[2023-12-27 15:11:00] [info] #011at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:246)
[2023-12-27 15:11:00] [info] #011at org.xwiki.job.AbstractJob.run(AbstractJob.java:223)
[2023-12-27 15:11:00] [info] #011… 1 common frames omitted
[2023-12-27 15:11:00] [info] Caused by: com.xpn.xwiki.store.migration.DataMigrationException: Error when performing the query to access filters
[2023-12-27 15:11:00] [info] #011at org.xwiki.notifications.filters.migration.R151002000XWIKI21448DataMigration.internalHibernateMigrate(R151002000XWIKI21448DataMigration.java:186)
[2023-12-27 15:11:00] [info] #011at org.xwiki.notifications.filters.migration.R151002000XWIKI21448DataMigration.hibernateMigrate(R151002000XWIKI21448DataMigration.java:119)
[2023-12-27 15:11:00] [info] #011at com.xpn.xwiki.store.migration.hibernate.AbstractHibernateDataMigration.migrate(AbstractHibernateDataMigration.java:118)
[2023-12-27 15:11:00] [info] #011… 22 common frames omitted
[2023-12-27 15:11:00] [info] Caused by: org.xwiki.query.QueryException: Exception while executing query. Query statement = [select nfp.pageOnly from DefaultNotificationFilterPreference nfp where nfp.pageOnly IS NOT NULL AND nfp.pageOnly <> ‘’ AND nfp.pageOnly > xwiki:KDE.Netzwerk.WebHome group by nfp.pageOnly order by nfp.pageOnly]
[2023-12-27 15:11:00] [info] #011at com.xpn.xwiki.store.hibernate.query.HqlQueryExecutor.execute(HqlQueryExecutor.java:184)
[2023-12-27 15:11:00] [info] #011at org.xwiki.query.internal.DefaultQueryExecutorManager.execute(DefaultQueryExecutorManager.java:72)
[2023-12-27 15:11:00] [info] #011at org.xwiki.query.internal.DefaultQuery.execute(DefaultQuery.java:306)
[2023-12-27 15:11:00] [info] #011at org.xwiki.notifications.filters.migration.R151002000XWIKI21448DataMigration.internalHibernateMigrate(R151002000XWIKI21448DataMigration.java:161)
[2023-12-27 15:11:00] [info] #011… 24 common frames omitted
[2023-12-27 15:11:00] [info] Caused by: com.xpn.xwiki.XWikiException: Error number 0 in 3: Exception while hibernate execute
[2023-12-27 15:11:00] [info] #011at com.xpn.xwiki.store.XWikiHibernateBaseStore.execute(XWikiHibernateBaseStore.java:835)
[2023-12-27 15:11:00] [info] #011at com.xpn.xwiki.store.XWikiHibernateBaseStore.executeRead(XWikiHibernateBaseStore.java:902)
[2023-12-27 15:11:00] [info] #011at com.xpn.xwiki.store.hibernate.query.HqlQueryExecutor.execute(HqlQueryExecutor.java:169)
[2023-12-27 15:11:00] [info] #011… 27 common frames omitted
[2023-12-27 15:11:00] [info] Caused by: java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: xwiki near line 1, column 180 [select nfp.pageOnly from org.xwiki.notifications.filters.internal.DefaultNotificationFilterPreference nfp where nfp.pageOnly IS NOT NULL AND nfp.pageOnly <> ‘’ AND nfp.pageOnly > xwiki:KDE.Netzwerk.WebHome group by nfp.pageOnly order by nfp.pageOnly]
[2023-12-27 15:11:00] [info] #011at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:138)
[2023-12-27 15:11:00] [info] #011at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:181)
[2023-12-27 15:11:00] [info] #011at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:188)
[2023-12-27 15:11:00] [info] #011at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:757)
[2023-12-27 15:11:00] [info] #011at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:114)
[2023-12-27 15:11:00] [info] #011at org.hibernate.engine.spi.SessionDelegatorBaseImpl.createQuery(SessionDelegatorBaseImpl.java:576)
[2023-12-27 15:11:00] [info] #011at com.xpn.xwiki.internal.store.hibernate.legacy.LegacySessionImplementor.createQuery(LegacySessionImplementor.java:127)
[2023-12-27 15:11:00] [info] #011at com.xpn.xwiki.internal.store.hibernate.legacy.LegacySessionImplementor.createQuery(LegacySessionImplementor.java:48)
[2023-12-27 15:11:00] [info] #011at com.xpn.xwiki.store.hibernate.query.HqlQueryExecutor.createQuery(HqlQueryExecutor.java:223)
[2023-12-27 15:11:00] [info] #011at com.xpn.xwiki.store.hibernate.query.HqlQueryExecutor.lambda$execute$0(HqlQueryExecutor.java:170)
[2023-12-27 15:11:00] [info] #011at com.xpn.xwiki.store.XWikiHibernateBaseStore.execute(XWikiHibernateBaseStore.java:826)
[2023-12-27 15:11:00] [info] #011… 29 common frames omitted
[2023-12-27 15:11:00] [info] Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: xwiki near line 1, column 180 [select nfp.pageOnly from org.xwiki.notifications.filters.internal.DefaultNotificationFilterPreference nfp where nfp.pageOnly IS NOT NULL AND nfp.pageOnly <> ‘’ AND nfp.pageOnly > xwiki:KDE.Netzwerk.WebHome group by nfp.pageOnly order by nfp.pageOnly]
[2023-12-27 15:11:00] [info] #011at org.hibernate.hql.internal.ast.QuerySyntaxException.convert(QuerySyntaxException.java:74)
[2023-12-27 15:11:00] [info] #011at org.hibernate.hql.internal.ast.ErrorTracker.throwQueryException(ErrorTracker.java:93)
[2023-12-27 15:11:00] [info] #011at org.hibernate.hql.internal.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:301)
[2023-12-27 15:11:00] [info] #011at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:189)
[2023-12-27 15:11:00] [info] #011at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:144)
[2023-12-27 15:11:00] [info] #011at org.hibernate.engine.query.spi.HQLQueryPlan.(HQLQueryPlan.java:112)
[2023-12-27 15:11:00] [info] #011at org.hibernate.engine.query.spi.HQLQueryPlan.(HQLQueryPlan.java:73)
[2023-12-27 15:11:00] [info] #011at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:162)
[2023-12-27 15:11:00] [info] #011at org.hibernate.internal.AbstractSharedSessionContract.getQueryPlan(AbstractSharedSessionContract.java:636)
[2023-12-27 15:11:00] [info] #011at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:748)

Any help is welcomed!
Thank you very much.

Regards,
Alex

3 Likes

No idea about it, but I’m very careful when updating: may I ask from what version were you upgrading from?

According database table xwikidbversion it is 150700001. I assume it is 15.7.0

1 Like

Thank you, I’m on 14.x so I’ll keep an eye on this thead.

Hi, thanks for reporting it, I opened a ticket for it Loading... and will fix it soon. We’ll probably need to release a 15.10.3 fast but given the time of the year it might not be before next week.

1 Like

Hello,

same issue on debian 12 when trying to migrate from 15.10.1 to 15.10.2
Back to 15.10.1 and xwiki seems to run well

What is strange is that i have the same message:
Migration of database [xwiki] has failed, it could not be safely used! Database is currently in version [150700001] while the required version is [151002000]

but i was and i’m again in version 15.10.1

@alexw I have a local patch would you be ok to test it on your instance so that we can ship fast a fix for everyone? My patch cannot be harmful AFAICS.

1 Like

The version 150700001 you’re seeing is the version of last migration: there was just no DB migration between 15.07 and 15.10.1.

Yes, I would test your fix.

2 Likes

Same problem here, after the upgrade to Xwiki 15.10.2 my test wiki is broken:

com.xpn.xwiki.store.migration.DataMigrationException: Migration of database [xwiki] has failed, it could not be safely used! Database is currently in version [150700001] while the required version is [151002000].

We hope to be able to release a 15.10.3 tomorrow with a fix for this. We’re currently conducting tests to ensure the patch is good.

4 Likes

I’m in the same boat with 150700001 to 151002000 migration failing.

Hello all,

I just released XWiki 15.10.3 with a fix for the migration issue you all experienced.

Sorry for the inconvenience. And of course keep raising issues, that’s really valuable!

Problem fixed with 15.10.3. xWiki is runnig again. Thanks for the quick fix!

2 Likes