Issue with mysq upgrading to 14.6 (ROW_FORMAT) fixed

I just upgrade a wiki on ubuntu from 13.10.2 to 14.6 via apt-get. There was an issue with the mysql table upgrades that took some time.
There was an error on the step of

alter table xwiki.xwikidoc add column XWD_ORIGINAL_METADATA_AUTHOR varchar(768)

That read:

The maximum row size for the used table type, not counting BLOBs, is 8126.
At the end I could fix it by doing:

ALTER TABLE xwiki.xwikidoc  ROW_FORMAT=DYNAMIC;
alter table xwiki.xwikidoc add column XWD_ORIGINAL_METADATA_AUTHOR varchar(768)

And restarting tomcat9 so it could continue the install.

Everything seems fine now

It seems that the same error happens on the rest of the wikis in the same setup (in this case subwiki), same fix also did work

Error number 3202 in 3: Exception while reading document [subwiki:Main.WebHome()]

com.xpn.xwiki.XWikiException: Error number 3202 in 3: Exception while reading document [subwiki:Main.WebHome()]
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:2173)
at com.xpn.xwiki.XWiki.getDocument(XWiki.java:2235)
at com.xpn.xwiki.XWiki.prepareDocuments(XWiki.java:5770)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:498)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:289)
at com.xpn.xwiki.web.LegacyActionServlet.service(LegacyActionServlet.java:114)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:122)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.xwiki.wysiwyg.filter.ConversionFilter.doFilter(ConversionFilter.java:61)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:132)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:688)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:747)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:375)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1639)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: com.xpn.xwiki.XWikiException: Error number 3301 in 3: Exception while switching to wiki subwiki
at com.xpn.xwiki.internal.store.hibernate.HibernateStore.setWiki(HibernateStore.java:710)
at com.xpn.xwiki.internal.store.hibernate.HibernateStore.setWiki(HibernateStore.java:663)
at com.xpn.xwiki.internal.store.hibernate.HibernateStore.beginTransaction(HibernateStore.java:865)
at com.xpn.xwiki.store.XWikiHibernateBaseStore.beginTransaction(XWikiHibernateBaseStore.java:576)
at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:1024)
… 49 more
Caused by: com.xpn.xwiki.store.migration.DataMigrationException: Migration of database [subwiki] has failed, it could not be safely used! Database is currently in version [130406000] while the required version is [140600000].
at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.preventAccessToOutdatedDb(AbstractDataMigrationManager.java:591)
at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.checkDatabase(AbstractDataMigrationManager.java:542)
at com.xpn.xwiki.internal.store.hibernate.HibernateStore.setWiki(HibernateStore.java:704)
… 53 more
Caused by: com.xpn.xwiki.store.migration.DataMigrationException: Unable to update schema of wiki [subwiki]
at com.xpn.xwiki.store.migration.hibernate.HibernateDataMigrationManager.updateSchema(HibernateDataMigrationManager.java:193)
at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.migrateDatabase(AbstractDataMigrationManager.java:735)
at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.startMigrations(AbstractDataMigrationManager.java:667)
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:704)
at com.xpn.xwiki.internal.store.hibernate.HibernateStore.setWiki(HibernateStore.java:663)
at com.xpn.xwiki.internal.store.hibernate.HibernateStore.beginTransaction(HibernateStore.java:865)
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:2173)
at com.xpn.xwiki.XWiki.getDocument(XWiki.java:2235)
at com.xpn.xwiki.XWiki.initializeMandatoryDocument(XWiki.java:1448)
at com.xpn.xwiki.XWiki.initializeMandatoryDocuments(XWiki.java:1415)
at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:1324)
at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:1261)
at com.xpn.xwiki.XWiki.(XWiki.java:1234)
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)
… 1 more
Caused by: org.hibernate.HibernateException: Failed to update the database. See the log for all errors
at com.xpn.xwiki.internal.store.hibernate.HibernateStore.updateDatabase(HibernateStore.java:1150)
at com.xpn.xwiki.internal.store.hibernate.HibernateStore.updateDatabase(HibernateStore.java:1004)
at com.xpn.xwiki.internal.store.hibernate.HibernateStore.updateDatabase(HibernateStore.java:1171)
at com.xpn.xwiki.store.XWikiHibernateBaseStore.updateSchema(XWikiHibernateBaseStore.java:264)
at com.xpn.xwiki.store.migration.hibernate.HibernateDataMigrationManager.hibernateShemaUpdate(HibernateDataMigrationManager.java:208)
at com.xpn.xwiki.store.migration.hibernate.HibernateDataMigrationManager.updateSchema(HibernateDataMigrationManager.java:189)
… 23 more
Caused by: org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL “alter table subwiki.xwikidoc add column XWD_ORIGINAL_METADATA_AUTHOR varchar(768)” via JDBC Statement
at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:67)
at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.applySqlString(AbstractSchemaMigrator.java:581)
at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.applySqlStrings(AbstractSchemaMigrator.java:602)
at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.migrateTable(AbstractSchemaMigrator.java:314)
at org.hibernate.tool.schema.internal.GroupedSchemaMigratorImpl.performTablesMigration(GroupedSchemaMigratorImpl.java:78)
at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.performMigration(AbstractSchemaMigrator.java:220)
at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.doMigration(AbstractSchemaMigrator.java:123)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:94)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:63)
at com.xpn.xwiki.internal.store.hibernate.HibernateStore.updateDatabase(HibernateStore.java:1137)
… 28 more
Caused by: java.sql.SQLSyntaxErrorException: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
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.StatementImpl.executeInternal(StatementImpl.java:763)
at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:648)
at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:193)
at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:193)
at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:193)
at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:54)
… 37 more

This is actually supposed to be done automatically by the R140200010XWIKI19207 migration, it’s checking all tables to make sure they are using DYNAMIC raw format. Did you keep the migration log before the error by any chance ?

Hi @tmontagne, I can’t find the location for that log, do you know where should it be?

It depends on your system, but you have some common locations listed on https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Logging#HMainLogs.

In any case, it would be great if you could create a BUG on Loading... with all the information you have so far. Will have to find a way to reproduce it to understand why the automatic migration did not do its job.