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

SQL errors when using MySQL connector 8.0.29 on Tomcat when running XWiki on Windows

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Critical
    • None
    • 13.10.6, 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
    • Unknown

    Description

      STEPS TO REPRODUCE

      1. Configure a fresh XWiki instance on Tomcat (tested with Tomcat 9.0.64) and MySQL 8 database using mysql-connector-java-8.0.29.jar connector
      2. Start XWiki
      3. Access the instance in browser
      4. Observe the console

      EXPECTED RESULTS

      No errors are encountered.

      ACTUAL RESULTS

      In XWiki console, the following errors are displayed:

      2022-06-17 15:00:00,027 [XWiki initialization] WARN  o.h.e.j.s.SqlExceptionHelper   - SQL Error: 1366, SQLState: HY000
      2022-06-17 15:00:00,027 [XWiki initialization] ERROR o.h.e.j.s.SqlExceptionHelper   - Incorrect string value: '\x85</pre...' for column 'XWR_PATCH' at row 1
      2022-06-17 15:00:00,043 [XWiki initialization] ERROR c.x.x.XWiki                    - Failed to initialize mandatory document [XWiki.EventStream.Code.EventClass]
      com.xpn.xwiki.XWikiException: Error number 3201 in 3: Exception while saving document xwiki:XWiki.EventStream.Code.EventClass
              at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:734)
              at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:259)
              at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:219)
              at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:2076)
              at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1981)
              at com.xpn.xwiki.XWiki.initializeMandatoryDocument(XWiki.java:1442)
              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: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute statement
              at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:154)
              at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:181)
              at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:188)
              at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1411)
              at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:489)
              at org.hibernate.internal.SessionImpl.flushBeforeTransactionCompletion(SessionImpl.java:3290)
              at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:2425)
              at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.beforeTransactionCompletion(JdbcCoordinatorImpl.java:449)
              at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.beforeCompletionCallback(JdbcResourceLocalTransactionCoordinatorImpl.java:183)
              at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.access$300(JdbcResourceLocalTransactionCoordinatorImpl.java:40)
              at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.commit(JdbcResourceLocalTransactionCoordinatorImpl.java:281)
              at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:101)
              at com.xpn.xwiki.internal.store.hibernate.HibernateStore.endTransaction(HibernateStore.java:895)
              at com.xpn.xwiki.store.XWikiHibernateBaseStore.endTransaction(XWikiHibernateBaseStore.java:602)
              at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:725)
              ... 13 common frames omitted
      Caused by: org.hibernate.exception.GenericJDBCException: could not execute statement
              at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
              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.executeUpdate(ResultSetReturnImpl.java:200)
              at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:46)
              at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3571)
              at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:3438)
              at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3852)
              at org.hibernate.action.internal.EntityUpdateAction.execute(EntityUpdateAction.java:201)
              at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:604)
              at org.hibernate.engine.spi.ActionQueue.lambda$executeActions$1(ActionQueue.java:478)
              at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:721)
              at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:475)
              at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:344)
              at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:40)
              at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:107)
              at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1407)
              ... 24 common frames omitted
      Caused by: java.sql.SQLException: Incorrect string value: '\x85</pre...' for column 'XWR_PATCH' at row 1
              at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
              at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
              at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:916)
              at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1061)
              at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1009)
              at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1320)
              at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdate(ClientPreparedStatement.java:994)
              at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:136)
              at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:136)
              at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:136)
              at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:197)
              ... 37 common frames omitted

      The issue seems to be reproducing only on Tomcat, as I couldn't reproduce it on Jetty (tested by configuring the standard Jetty package with MySQL 8). However, the DW is reached.

      Also, the issue couldn't be reproduced with mysql-connector-java-8.0.28.jar.

       

      I've tested on the following setups:

      On Windows 11, Jetty (local, non-Docker instances):

      • MySQL server 8.0.29 and connector 8.0.29: XWiki 13.10.6, 14.4.1 - the issue did not reproduce
      • MySQL server 8.0.30 and connector 8.0.30: XWiki 14.4.3 - the issue did not reproduce

      On Windows 11, Tomcat 9.0.65 (Docker instances):

      • MySQL server 8.0.29 and 8.0.29 connector:  XWiki 14.4.2 - the issue did not reproduce
      • MySQL server 8.0.30 and 8.0.30 connector:  XWiki 14.4.3 - the issue did not reproduce

      On Windows 11, Tomcat 9.0.65 (local, non-Docker instances):

      • MySQL server 8.0.29 and connector 8.0.29: XWiki 13.10.6, 14.4.1 - the issue reproduces
      • MySQL server 8.0.30 and connector 8.0.30: XWiki 14.4.3 - the issue reproduces

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              iandriuta Ilie Andriuta
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: