Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-158856

treePath field itsn't present at JournalArticle table when upgrading from 6.1 to 7.4

Details

    • 4

    Description

      Description
      During the upgrade process, one of the "update" operations is falling (

      update JournalArticle set folderId = 0, treePath = '/';"
      

      ) , the treePath field at JournalArticle table it's not present on the 6.1 schema

      Steps to Reproduce

      1. Reset your 7.4 Database
      2. Import the .mysql data_archive attached bellow
      3. Execute the mysql schema upgrade [sudo mysqld --user={yourUser} --upgrade=FORCE]
      4. In your 7.4 bundles, go to tools/portal-tools-db-upgrade-client and run the db_upgrade.sh

       Expected Result: The upgrade would complete successfully.
       Actual Result: The upgrade fails with the following error:

      2022-07-21 19:58:26.228 ERROR [main][DBUpgrader:79] nullcom.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update JournalArticle set folderId = 0, treePath = '/';alter table User_ add lda' at line 1	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:107) ~[portal-kernel.jar:?]	at com.liferay.portal.upgrade.Pre7UpgradeProcess.upgrade(Pre7UpgradeProcess.java:49) ~[portal-impl.jar:?]	at com.liferay.portal.kernel.upgrade.util.UpgradeProcessUtil._upgradeProcess(UpgradeProcessUtil.java:160) ~[portal-kernel.jar:?]	at com.liferay.portal.kernel.upgrade.util.UpgradeProcessUtil.upgradeProcess(UpgradeProcessUtil.java:136) ~[portal-kernel.jar:?]	at com.liferay.portal.events.StartupHelperUtil.upgradeProcess(StartupHelperUtil.java:173) ~[portal-impl.jar:?]	at com.liferay.portal.tools.DBUpgrader.upgradePortal(DBUpgrader.java:233) ~[portal-impl.jar:?]	at com.liferay.portal.tools.DBUpgrader.main(DBUpgrader.java:137) [portal-impl.jar:?]	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_221]	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_221]	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_221]	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_221]	at com.liferay.portal.tools.db.upgrade.client.DBUpgraderLauncher.main(DBUpgraderLauncher.java:54) [com.liferay.portal.tools.db.upgrade.client.jar:?]Caused by: com.liferay.portal.kernel.upgrade.UpgradeException: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update JournalArticle set folderId = 0, treePath = '/';alter table User_ add lda' at line 1	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:107) ~[portal-kernel.jar:?]	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:129) ~[portal-kernel.jar:?]	at com.liferay.portal.upgrade.UpgradeProcess_6_2_0.doUpgrade(UpgradeProcess_6_2_0.java:299) ~[portal-impl.jar:?]	at com.liferay.portal.kernel.upgrade.UpgradeProcess.lambda$upgrade$0(UpgradeProcess.java:101) ~[portal-kernel.jar:?]	at com.liferay.portal.db.partition.DBPartitionUtil.forEachCompanyId(DBPartitionUtil.java:118) ~[portal-impl.jar:?]	at com.liferay.portal.dao.db.BaseDB.process(BaseDB.java:356) ~[portal-impl.jar:?]	at com.liferay.portal.kernel.dao.db.BaseDBProcess.process(BaseDBProcess.java:390) ~[portal-kernel.jar:?]	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:88) ~[portal-kernel.jar:?]	... 11 moreCaused by: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update JournalArticle set folderId = 0, treePath = '/';alter table User_ add lda' at line 1	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120) ~[mysql.jar:8.0.21]	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[mysql.jar:8.0.21]	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql.jar:8.0.21]	at com.mysql.cj.jdbc.StatementImpl.executeUpdateInternal(StatementImpl.java:1335) ~[mysql.jar:8.0.21]	at com.mysql.cj.jdbc.StatementImpl.executeLargeUpdate(StatementImpl.java:2108) ~[mysql.jar:8.0.21]	at com.mysql.cj.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1245) ~[mysql.jar:8.0.21]	at com.zaxxer.hikari.pool.ProxyStatement.executeUpdate(ProxyStatement.java:119) ~[hikaricp.jar:?]	at com.zaxxer.hikari.pool.HikariProxyStatement.executeUpdate(HikariProxyStatement.java) ~[hikaricp.jar:?]	at com.liferay.portal.dao.db.BaseDB.runSQL(BaseDB.java:413) ~[portal-impl.jar:?]	at com.liferay.portal.dao.db.BaseDB.runSQL(BaseDB.java:379) ~[portal-impl.jar:?]	at com.liferay.portal.kernel.dao.db.BaseDBProcess.runSQL(BaseDBProcess.java:106) ~[portal-kernel.jar:?]	at com.liferay.portal.upgrade.v6_2_0.UpgradeSchema._upgradeSchemaDefault(UpgradeSchema.java:74) ~[portal-impl.jar:?]	at com.liferay.portal.upgrade.v6_2_0.UpgradeSchema.doUpgrade(UpgradeSchema.java:49) ~[portal-impl.jar:?]	at com.liferay.portal.kernel.upgrade.UpgradeProcess.lambda$upgrade$0(UpgradeProcess.java:101) ~[portal-kernel.jar:?]	at com.liferay.portal.db.partition.DBPartitionUtil.forEachCompanyId(DBPartitionUtil.java:118) ~[portal-impl.jar:?]	at com.liferay.portal.dao.db.BaseDB.process(BaseDB.java:356) ~[portal-impl.jar:?]	at com.liferay.portal.kernel.dao.db.BaseDBProcess.process(BaseDBProcess.java:390) ~[portal-kernel.jar:?]	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:88) ~[portal-kernel.jar:?]	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:129) ~[portal-kernel.jar:?]	at com.liferay.portal.upgrade.UpgradeProcess_6_2_0.doUpgrade(UpgradeProcess_6_2_0.java:299) ~[portal-impl.jar:?]	at com.liferay.portal.kernel.upgrade.UpgradeProcess.lambda$upgrade$0(UpgradeProcess.java:101) ~[portal-kernel.jar:?]	at com.liferay.portal.db.partition.DBPartitionUtil.forEachCompanyId(DBPartitionUtil.java:118) ~[portal-impl.jar:?]	at com.liferay.portal.dao.db.BaseDB.process(BaseDB.java:356) ~[portal-impl.jar:?]	at com.liferay.portal.kernel.dao.db.BaseDBProcess.process(BaseDBProcess.java:390) ~[portal-kernel.jar:?]	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:88) ~[portal-kernel.jar:?]	... 11 more
      

      For more references: https://gist.github.com/lucasperj/ed2c30602fec3af62e728359a2f1a720

      Attachments

        Issue Links

          Activity

            People

              lucas.falcao Lucas Falcao
              lucas.falcao Lucas Falcao
              Kiyoshi Lee Kiyoshi Lee
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                10 weeks ago

                Packages

                  Version Package
                  7.4.3.36 CE GA36
                  Master