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

Upgrading from 6.1 to 7.1 may cause constraint violation due to duplicated DLFileEntryMetadata entries

Details

    Description

      Steps to Reproduce

      1. Start on 6.1 making sure the fix for LPS-30576 is not included
      2. Create two new portal instances
      3. Add a file entry to the main instance
      4. Upgrade to 6.2
      5. Checkout and check in the file entry without making any modifications
      6. Upgrade to Master and receive an error similar to the following:
      2018-12-18 13:59:22.015 INFO  [main][UpgradeProcess:107] Failed upgrade process com.liferay.portal.upgrade.v7_0_1.UpgradeDocumentLibrary in 14 ms
      2018-12-18 13:59:22.015 INFO  [main][UpgradeProcess:107] Failed upgrade process com.liferay.portal.upgrade.UpgradeProcess_7_0_1 in 55 ms
      com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '11058-10928' for key 'IX_7332B44F'
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:101)
      	at com.liferay.portal.kernel.upgrade.util.UpgradeProcessUtil._upgradeProcess(UpgradeProcessUtil.java:176)
      	at com.liferay.portal.kernel.upgrade.util.UpgradeProcessUtil.upgradeProcess(UpgradeProcessUtil.java:143)
      	at com.liferay.portal.kernel.upgrade.util.UpgradeProcessUtil.upgradeProcess(UpgradeProcessUtil.java:125)
      	at com.liferay.portal.events.StartupHelper.upgradeProcess(StartupHelper.java:151)
      	at com.liferay.portal.events.StartupHelperUtil.upgradeProcess(StartupHelperUtil.java:85)
      	at com.liferay.portal.tools.DBUpgrader.upgrade(DBUpgrader.java:174)
      	at com.liferay.portal.tools.DBUpgrader.main(DBUpgrader.java:107)
      	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:55)
      Caused by: com.liferay.portal.kernel.upgrade.UpgradeException: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '11058-10928' for key 'IX_7332B44F'
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:101)
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:142)
      	at com.liferay.portal.upgrade.UpgradeProcess_7_0_1.doUpgrade(UpgradeProcess_7_0_1.java:42)
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:96)
      	... 12 more
      Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '11058-10928' for key 'IX_7332B44F'
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      	at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
      	at com.mysql.jdbc.Util.getInstance(Util.java:386)
      	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1040)
      	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4120)
      	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4052)
      	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2503)
      	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2664)
      	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2794)
      	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)
      	at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1379)
      	at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
      	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
      	at com.liferay.portal.upgrade.v7_0_1.UpgradeDocumentLibrary.updateTikaRawMetadataFileEntryMetadata(UpgradeDocumentLibrary.java:163)
      	at com.liferay.portal.upgrade.v7_0_1.UpgradeDocumentLibrary.doUpgrade(UpgradeDocumentLibrary.java:61)
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:96)
      	... 15 more
      

      Steps 1-7 can be avoided by importing reproduce_62.sql and then upgrading to 7.0.

      Attachments

        Activity

          People

            beck.liu Beck Liu
            jonathan.mccann Jonathan McCann
            Kiyoshi Lee Kiyoshi Lee
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              3 years, 41 weeks, 4 days ago

              Packages

                Version Package
                7.1.10 DXP FP7
                7.1.10.2 SP2
                7.1.3 CE GA4
                7.1.X
                Master