PUBLIC - Liferay Portal Community Edition
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-43189

With UUID_ not being provided when inserting into DLFileVersion, it will fail with unique constraint on IX_C99B2650 sometimes

    Details

    • Branch Version/s:
      6.2.x
    • Backported to Branch:
      Committed
    • Story Points:
      8
    • Similar Issues:
      Show 4 results 

      Description

      Reproduction steps
      1. Connect Liferay 6.1 GA2 with Oracle DB.
      2. Post two or more threads with attachment in Message Board Portlet
      3. Copy the document_library folder to 6.2.10 bundle.
      4. Set verify.processes= in portal-ext for 6.2.10 to bypass the verification process
      5. Start the server and upgrade

      Issue
      The issue persists in trunk. We will get the following messages when we use Oracle Database:
      09:05:43,677 WARN [localhost-startStop-1][BaseUpgradeAttachments:174] Unable to add file version 1.0 for file entry IMG_3088.JPG
      java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (LPORTALTEST.IX_C99B2650) violated_ [Sanitized]

      Error and Logs
      The full log is attached.

      Analysis
      Failed Query Report SQL=insert into DLFileVersion (fileVersionId, groupId, companyId, userId, userName, createDate, modifiedDate, repositoryId, folderId, fileEntryId, extension, mimeType, title, description, changeLog, extraSettings, fileEntryTypeId, version, size_, status, statusByUserId, statusByUserName, statusDate) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);

      We have defined IX_C99B2650 as unique one:
      create unique index IX_C99B2650 on DLFileVersion (uuid_, groupId);

      With UUID_ not being provided, it will be set to NULL for the first entry for a groupid and fail with a unique constraint for all other insert attempts in this method.

      So we can consider modify com.liferay.portal.kernel.upgrade.v6_2_0.BaseUpgradeAttachments.addDLFileVersion line 138, 140 and 169 as:
      Line 138: sb.append("status, statusByUserId, statusByUserName, statusDate, uuid_) ");
      Line 140: sb.append("?, ?, ?, ?, ?, ?, ?, ?, ?)");
      Line 169: ps.setString(24, PortalUUIDUtil.generate());

        Activity

        Hide
        Vincent Liu added a comment -

        Thanks Dale for pointing it out. I tried that and the issue can be reproduced with clean oracle database. I will update the ticket description with reproducing steps shortly.

        Show
        Vincent Liu added a comment - Thanks Dale for pointing it out. I tried that and the issue can be reproduced with clean oracle database. I will update the ticket description with reproducing steps shortly.
        Hide
        Shitian "Shelton" Zhang added a comment -

        PASSED Manual Testing following the steps in the description.

        Reproduced on:
        Tomcat 7.0.42 + Oracle 11.2.0.1.0. Portal master GIT ID: 4b3123380630e1bfc59b2508481cb3ef544657b2.

        The warn message mentioned in description was thrown when upgrading com.liferay.portal.upgrade.v6_2_0.UpgradeMessageBoardsAttachments.

        Fixed on:
        Tomcat 7.0.42 + Oracle 11.2.0.1.0. Portal master GIT ID: 28cfc25939be6e0ded6198a9d03cdbc2e6a076ff.

        Upgrade successfully without the warn message.

        Show
        Shitian "Shelton" Zhang added a comment - PASSED Manual Testing following the steps in the description. Reproduced on: Tomcat 7.0.42 + Oracle 11.2.0.1.0. Portal master GIT ID: 4b3123380630e1bfc59b2508481cb3ef544657b2. The warn message mentioned in description was thrown when upgrading com.liferay.portal.upgrade.v6_2_0.UpgradeMessageBoardsAttachments . Fixed on: Tomcat 7.0.42 + Oracle 11.2.0.1.0. Portal master GIT ID: 28cfc25939be6e0ded6198a9d03cdbc2e6a076ff. Upgrade successfully without the warn message.
        Hide
        Shitian "Shelton" Zhang added a comment -

        PASSED Manual Testing following the steps in the description.

        Fixed on:
        Tomcat 7.0.42 + Oracle 11.2.0.1.0. Portal ee-6.2.x EE GIT ID: bf7b7dbe436b6fd40781e14efb5871ea66d65cf8.

        Upgrade successfully without the warn message.

        Show
        Shitian "Shelton" Zhang added a comment - PASSED Manual Testing following the steps in the description. Fixed on: Tomcat 7.0.42 + Oracle 11.2.0.1.0. Portal ee-6.2.x EE GIT ID: bf7b7dbe436b6fd40781e14efb5871ea66d65cf8. Upgrade successfully without the warn message.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              1 year, 10 weeks, 5 days ago

              Development

                Structure Helper Panel