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

A data inconsistency in some page permissions causes Liferay to stop working, an error is displayed on the browser and you are not able to login

Details

    Description

      A data inconsistency in some page permissions causes Liferay to stop working, "An unexpected system error occurred" error is displayed on the browser and you are not able to login

      This can easily reproduced in case you have a children Layout without ResourcePermission records, a
      java.lang.IllegalArgumentException is thrown and it is not catch anywhere, so it is finally displayed directly to the final user.

      As you are not able to enter in the Liferay user interface, it is not possible to fix the problem unless you manually update the database.

      The root cause of the user interface error is in the TemplateContextHelper class, as it is including in the context object a navItems that contains all the Navigation items, but in case it fails, the error is not catch and it is directly displayed to the final user.

      Just changing the exception catch from PortalException to Exception will avoid the error on the user interface but it will be written to the log file.

      Steps to reproduce

      1. Create a widget page called ParentPage
      2. Create a child widget page of ParentPage called ChildPage
      3. Execute following SQL to delete the resource permissions record and generate a fake database inconsistence:
        • delete from resourcepermission where primKeyId in (select plid from layout where name like '%ChildPage%') and name = 'com.liferay.portal.kernel.model.Layout'
      4. Restart Liferay server to clean all the caches
      5. Try to login:
      6. Expected error: Even though there are IllegalArgumentException exceptions in the log file, you can login in the Liferay installation
      7. Wrong error: You cannot login in the Liferay installation, An unexpected system error occurred message is displayed in the browser and it is not possible to log in

      Attachments

        Issue Links

          Activity

            People

              jayda.wu Jayda Wu
              jorge.diaz Jorge Diaz
              Javier Moral Javier Moral
              Jorge Diaz Jorge Diaz
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                1 year, 30 weeks ago

                Packages

                  Version Package
                  7.0.X
                  7.1.X
                  7.2.10 DXP FP17
                  7.2.10.6 DXP SP6
                  7.2.X
                  7.3.10.3 DXP SP3
                  7.3.X
                  7.4.3.5 CE GA5
                  7.4.13 DXP U1
                  Master