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

WARN message Unable to add list type in console during the upgrade of com.liferay.portal.upgrade.v7_4_x.UpgradeListType

    Description

    Steps to reproduce:

    1. Import the attached database dump of MariaDB.
    2. Upgrade the database to master.

    Expected result:
    No WARN message "Unable to add list type" in console.

    Actual result:
    Below WARN message in console:

    2020-11-25 09:22:18.177 INFO  [main][UpgradeProcess:101] Upgrading com.liferay.portal.upgrade.v7_4_x.UpgradeListType
    2020-11-25 09:22:18.189 WARN  [main][UpgradeListType:59] Unable to add list type
    java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'where not exists (select null from ListType where name = 'phone-number'and ty...' at line 1
    Query is:
    sql : 'insert into ListType (listTypeId, name, type_) select ?, ?, ? where not exists (select null from ListType where name = 'phone-number'and type_ = 'com.liferay.portal.kernel.model.Address.phone')', parameters : [101,'phone-number','com.liferay.portal.kernel.model.Address.phone']
    	at org.mariadb.jdbc.internal.SQLExceptionMapper.get(SQLExceptionMapper.java:138)
    	at org.mariadb.jdbc.internal.SQLExceptionMapper.throwException(SQLExceptionMapper.java:106)
    	at org.mariadb.jdbc.MySQLStatement.executeQueryEpilog(MySQLStatement.java:268)
    	at org.mariadb.jdbc.MySQLStatement.execute(MySQLStatement.java:296)
    	at org.mariadb.jdbc.MySQLStatement.executeUpdate(MySQLStatement.java:364)
    	at org.mariadb.jdbc.MySQLPreparedStatement.executeUpdate(MySQLPreparedStatement.java:148)
    	at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)
    	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)
    	at com.liferay.portal.upgrade.v7_4_x.UpgradeListType._addListType(UpgradeListType.java:55)
    	at com.liferay.portal.upgrade.v7_4_x.UpgradeListType.doUpgrade(UpgradeListType.java:34)
    	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:104)
    	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:131)
    	at com.liferay.portal.upgrade.PortalUpgradeProcess.doUpgrade(PortalUpgradeProcess.java:130)
    	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:104)
    	at com.liferay.portal.kernel.upgrade.util.UpgradeProcessUtil._upgradeProcess(UpgradeProcessUtil.java:156)
    	at com.liferay.portal.kernel.upgrade.util.UpgradeProcessUtil.upgradeProcess(UpgradeProcessUtil.java:119)
    	at com.liferay.portal.events.StartupHelperUtil.upgradeProcess(StartupHelperUtil.java:182)
    	at com.liferay.portal.tools.DBUpgrader._upgradePortal(DBUpgrader.java:334)
    	at com.liferay.portal.tools.DBUpgrader.upgrade(DBUpgrader.java:151)
    	at com.liferay.portal.tools.DBUpgrader.upgrade(DBUpgrader.java:143)
    	at com.liferay.portal.tools.DBUpgrader.main(DBUpgrader.java:123)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at com.liferay.portal.tools.db.upgrade.client.DBUpgraderLauncher.main(DBUpgraderLauncher.java:54)
    Caused by: org.mariadb.jdbc.internal.common.QueryException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'where not exists (select null from ListType where name = 'phone-number'and ty...' at line 1
    Query is:
    sql : 'insert into ListType (listTypeId, name, type_) select ?, ?, ? where not exists (select null from ListType where name = 'phone-number'and type_ = 'com.liferay.portal.kernel.model.Address.phone')', parameters : [101,'phone-number','com.liferay.portal.kernel.model.Address.phone']
    	at org.mariadb.jdbc.internal.mysql.MySQLProtocol.getResult(MySQLProtocol.java:995)
    	at org.mariadb.jdbc.internal.mysql.MySQLProtocol.executeQuery(MySQLProtocol.java:1050)
    	at org.mariadb.jdbc.internal.mysql.MySQLProtocol.executeQuery(MySQLProtocol.java:1030)
    	at org.mariadb.jdbc.MySQLStatement.execute(MySQLStatement.java:289)
    	... 22 more
    

    Reproduced on:
    Upgrade From: 7210
    Tomcat 9.0.37 + MariaDB 10.2. Portal master DXP GIT ID: cf5f0b9de37165381f866420408e6e7e7e014939.

      Attachments

        Activity

          People

          Assignee:
          sharry.shi Sharry Shi
          Reporter:
          summer.zhang Summer Zhang
          Participants of an Issue:
          Recent user:
          Sharry Shi
          Engineering Assignee:
          Pei-Jung Lan
          Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

            Dates

            Created:
            Updated:
            Resolved:
            Days since last comment:
            35 weeks, 2 days ago

              Packages

              Version Package
              Master