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

DXP Upgrade tool changes the upgrade properties file, potentially breaking the upgrade

    Details

    • Branch Version/s:
      7.0.x
    • Backported to Branch:
      Committed
    • Fix Priority:
      5

      Description

      portal-upgrade-ext.properties can be changed by merely running the upgrade tool. The upgrade tool will both re-order (not so bad, but a little annoying) and turn multi-line strings into single line strings (catastrophic, kills the upgrade)

      Example:

      Before tool:

      upgrade.processes.master=\
      		com.liferay.portal.upgrade.UpgradeProcess_6_0_12_to_6_1_0\,\
              com.liferay.portal.upgrade.UpgradeProcess_6_1_1\,\
              com.liferay.portal.upgrade.UpgradeProcess_6_2_0\,\
              com.liferay.portal.upgrade.UpgradeProcess_7_0_0\,\
              com.liferay.portal.upgrade.UpgradeProcess_7_0_1\,\
              com.liferay.portal.upgrade.UpgradeProcess_7_0_3
      module.framework.properties.osgi.console=localhost:11313
      index.on.upgrade=false
      verify.processes=com.liferay.portal.verify.VerifyProcessSuiteBREAKONPURPOSE
      

      After tool

      index.on.upgrade=false
      verify.processes=com.liferay.portal.verify.VerifyProcessSuiteBREAKONPURPOSE
      upgrade.processes.master=com.liferay.portal.upgrade.UpgradeProcess_6_0_12_to_6_1_0,com.liferay.portal.upgrade.UpgradeProcess_6_1_1,com.liferay.portal.upgrade.UpgradeProcess_6_2_0,com.liferay.portal.upgrade.UpgradeProcess_7_0_0,com.liferay.portal.upgrade.UpgradeProcess_7_0_1,com.liferay.portal.upgrade.UpgradeProcess_7_0_3
      module.framework.properties.osgi.console=localhost:11313
      

      which results in none of the upgrade code running, and the following error on my machine:

      Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid column name 'mvccVersion'.
      at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:217)
      at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1655)
      at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:440)
      at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:385)
      at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7505)
      at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2445)
      at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:191)
      at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:166)
      at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(SQLServerPreparedStatement.java:297)
      at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
      at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)
      at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
      at org.hibernate.loader.Loader.getResultSet(Loader.java:1953)
      at org.hibernate.loader.Loader.doQuery(Loader.java:802)
      at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
      at org.hibernate.loader.Loader.doList(Loader.java:2542)
      ... 65 more
      java.lang.NullPointerException
      at com.liferay.util.dao.orm.CustomSQLUtil.reloadCustomSQL(CustomSQLUtil.java:104)
      at com.liferay.portal.tools.DBUpgrader.upgrade(DBUpgrader.java:168)
      at com.liferay.portal.tools.DBUpgrader.main(DBUpgrader.java:99)
      

      I assume because:

      # Escape the comma so that the property can be properly interpolated. For
      # example, the property "upgrade.processes.6100" will not properly reference
      # the property "upgrade.processes.default" unless the commas are escaped.
      # See StartupHelper#getUpgradeProcessClassNames(String).
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                2 years, 21 weeks ago

                Packages

                Version Package
                7.0.X EE
                Master