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

Null DLFileEntry titles break the upgrade to 7.x

    Details

      Description

      Upgrading to 7.x the UpgradeDocumentLibrary throws a NPE in Oracle

      Steps to reproduce:

      1. Start 6.2.10 environment using Oracle
      2. Create a basic document without binary file in the Documents and Media, as title use "hello"
      3. Generate empty/null titles in DLFileEntry or DLFileVersion. To achieve that execute the following groovy script from Server Administration/Script replacing XXX for the dlfileEntryId field for the previous document:
        import com.liferay.portlet.documentlibrary.service.DLFileEntryLocalServiceUtil
        import com.liferay.portlet.documentlibrary.model.DLFileEntry
        import com.liferay.portal.kernel.util.StringPool
        
        DLFileEntry dlFileEntry = DLFileEntryLocalServiceUtil.getDLFileEntry(XXX)
        
        dlFileEntry.setTitle(StringPool.BLANK)
        
        DLFileEntryLocalServiceUtil.updateDLFileEntry(dlFileEntry)
        
      4. Stop the server and prepare the upgrade to 7.1.10 (database + data/document_library)
      5. Launch the upgrade tool

      The upgrade process stops with an NPE in logs

      2019-03-01 09:45:23.997 INFO  [main][UpgradeProcess:93] Upgrading com.liferay.portal.upgrade.v7_0_0.UpgradeDocumentLibrary
      2019-03-01 09:45:23.998 INFO  [main][LoggingTimer:83] Starting com.liferay.portal.upgrade.v7_0_0.UpgradeDocumentLibrary#updateFileEntryFileNames
      2019-03-01 09:45:29.253 INFO  [main][LoggingTimer:43] Completed com.liferay.portal.upgrade.v7_0_0.UpgradeDocumentLibrary#updateFileEntryFileNames in 5255 ms
      2019-03-01 09:45:29.254 INFO  [main][UpgradeProcess:107] Failed upgrade process com.liferay.portal.upgrade.v7_0_0.UpgradeDocumentLibrary in 5257 ms
      2019-03-01 09:45:29.255 INFO  [main][UpgradeProcess:107] Failed upgrade process com.liferay.portal.upgrade.UpgradeProcess_7_0_0 in 333019 ms
      com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: java.lang.NullPointerException
      	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: java.lang.NullPointerException
      	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_0.doUpgrade(UpgradeProcess_7_0_0.java:86)
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:96)
      	... 12 more
      Caused by: java.lang.NullPointerException
      	at com.liferay.portal.upgrade.v7_0_0.UpgradeDocumentLibrary._updateLongFileNames(UpgradeDocumentLibrary.java:570)
      	at com.liferay.portal.upgrade.v7_0_0.UpgradeDocumentLibrary.updateFileEntryFileNames(UpgradeDocumentLibrary.java:175)
      	at com.liferay.portal.upgrade.v7_0_0.UpgradeDocumentLibrary.doUpgrade(UpgradeDocumentLibrary.java:99)
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:96)
      	... 15 more
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              yvonne.han Yvonne Han
              Reporter:
              jose.jimenez Jose Jimenez
              Participants of an Issue:
              Recent user:
              Joel Garman
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 36 weeks ago

                  Packages

                  Version Package
                  7.0.0 DXP FP82
                  7.0.10.12 DXP SP12
                  7.0.X
                  7.1.10 DXP FP12
                  7.1.X
                  Master