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

Duplicate index IX_7332B44F when upgrading to Liferay 7.0.1

    Details

      Description

      There is an issue that is preventing to upgrade to Liferay 7.0.1. When running the upgrade, the following exception is thrown in the console

      3:40:52,898 INFO  [main][UpgradeProcess:98] Completed upgrade process com.liferay.portal.upgrade.UpgradeProcess_7_0_1 in 7923ms
      com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: java.sql.SQLIntegrityConstraintViolationException: Duplicate entry '3635611-128139' for key 'IX_7332B44F'
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:92)
      	at com.liferay.portal.kernel.upgrade.util.UpgradeProcessUtil._upgradeProcess(UpgradeProcessUtil.java:175)
      	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:164)
      	at com.liferay.portal.events.StartupHelperUtil.upgradeProcess(StartupHelperUtil.java:81)
      	at com.liferay.portal.tools.DBUpgrader.upgrade(DBUpgrader.java:153)
      	at com.liferay.portal.tools.DBUpgrader.main(DBUpgrader.java:99)
      Caused by: com.liferay.portal.kernel.upgrade.UpgradeException: java.sql.SQLIntegrityConstraintViolationException: Duplicate entry '3635611-128139' for key 'IX_7332B44F'
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:92)
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:116)
      	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:89)
      	... 7 more
      Caused by: java.sql.SQLIntegrityConstraintViolationException: Duplicate entry '3635611-128139' for key 'IX_7332B44F'
      	at org.mariadb.jdbc.internal.SQLExceptionMapper.get(SQLExceptionMapper.java:132)
      	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.MySQLPreparedStatement.execute(MySQLPreparedStatement.java:133)
      	at com.liferay.portal.upgrade.v7_0_1.UpgradeDocumentLibrary.updateTikaRawMetadataFileEntryMetadata(UpgradeDocumentLibrary.java:128)
      	at com.liferay.portal.upgrade.v7_0_1.UpgradeDocumentLibrary.doUpgrade(UpgradeDocumentLibrary.java:59)
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:89)
      	... 10 more
      Caused by: org.mariadb.jdbc.internal.common.QueryException: Duplicate entry '3635611-128139' for key 'IX_7332B44F'
      	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)
      	... 14 more
      
      

      Steps to reproduce the issue:

      1. Start Liferay 6.1 latest GA.
      2. Add a few images in Documents and Media and chech that the Automatically extracted metadata appears in the Documetns and Media indicating height and width on the right column.
      3. Stop the server.
      4. Upgrade to Liferay 6.2 latest GA.
      5. Go to Documents and Media and view any of the previous images. You will see that the Automatically extracted metadata is no longer displayed. (This was fixed in https://issues.liferay.com/browse/LPS-65441)
      6. Click in the actions button of any image and Check out the document.
      7. Without making any change in the document, click in the actions button and "Check in".
      8. At this point, if you view the image you should be able to see the Automatically extracted metadata again.
      9. Stop the server.
      10. Run the upgrade with the Upgrade tool to Liferay 7.0.1 (or latest GA)

      When you run the upgrade you should see the error described above in the console log.

      Other way to reproduce the issue

      Import the attached mysql dump into a Liferay 6.2 database (socialofficetest.sql). Then run the upgrade to Liferay 7.0.1 with the upgrade tool. You will see the errors in the console.

      Explanation of the issue

      This is happening because the database contains 2 rows in DLFileEntryMetadata table for the same fileVersionId (one that contains the information under the name "tikarawmetadata" and other under the name "TIKARAWMETADATA" and with different class name ids. Then, when the upgrade com.liferay.portal.upgrade.v7_0_1.UpgradeDocumentLibrary is running it's trying to do some renaming but it will fail because of the duplicate index.
      The fix removes one of the duplicates (they should be the same) and then do the renaming.

        Attachments

          Activity

            People

            Assignee:
            joyce.wang Joyce Wang
            Reporter:
            sergio.gonzalez Sergio Gonzalez (Inactive)
            Participants of an Issue:
            Recent user:
            Csaba Turcsan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              4 years, 3 weeks, 5 days ago

                Packages

                Version Package
                7.0.0 DXP FP11
                7.0.0 DXP SP2
                7.0.3 CE GA4
                7.1.X
                Master