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

Some paths fail with an NPE? in liferay.dev

    Details

      Description

      Like https://liferay.dev/ask/questions/development/difference-between-login-events-pre-and-login-events-post-1

       
      Javier Gamarra 
      Hi Jamie!
      19:07
      I’ve noticed that some Questions pages are failing (like https://liferay.dev/ask/questions/development/difference-between-login-events-pre-and-login-events-post-1) with an NPE in the API that finds related questions
      19:08
      can I test it in dev.liferay.dev? any way of getting the data? (edited) 
      19:19
      Javier Gamarra 
      it’s an API failure (NPE) so there are not many things we can do from questions
      19:51
      Javier Gamarra 
      it should be something data related
      19:51
      Ok, got one: https://liferay.dev/ask/questions/question/11015692
      19:52
      that question is different from the others and is missing something that causes an NPE
      19:54
      I think it’s the liferay question user
      Monday, August 2nd
       
      18:15
      Jamie Sammons 
      Hi Javi!
      18:15
      Since the Liferay Online team manages all of those environments I no longer have access to the logs or the latest data dump.
      18:16
      They are planning to provide me an anonymized db dump soon to test an upgrade to EP3.
      18:16
      So I could set up something with that.
      18:16
      Javier Gamarra 
      it’s not he latest though, I think that question is old
      18:16
      but I think the issue is the user, do you have how it was created?
      18:16
      Jamie Sammons 
      I also sent Eduardo a message asking how we go about request logs/db dumps when we need to troubleshoot these kinds of issues going foward.
      18:17
      If it's older I can see if I can recreate it with the dump I have from June from the migration to Liferay Online.
      18:18
      Javier Gamarra 
      but the user liferay question user what is it for?
      18:19
      Jamie Sammons 
      liferay question user? Is that the name of the actual poster?
      18:19
      My guess it was a spammer if that's the case.
      18:24
      Recreated locally but nothing is appearing in the logs.
      18:39
      Jamie Sammons 
      Okay the one with the user liferay question user maybe the result of a GDPR request anonymizing data.  It appears to set the user's name to that and set's the userId to 0.  However the Message Boards can't handle it because it can't find a user with the id 0:
      2021-08-02 16:32:21.612 ERROR [http-nio-8080-exec-10][IncludeTag:128] Current URL /forums-redirect/-/message_boards/message/11015692 generates exception: com.liferay.portal.kernel.exception.NoSuchUserException: No User exists with the primary key 0
      com.liferay.portal.kernel.exception.NoSuchUserException: No User exists with the primary key 0
      at com.liferay.portal.service.persistence.impl.UserPersistenceImpl.findByPrimaryKey(UserPersistenceImpl.java:8638) ~[portal-impl.jar:?]
      at com.liferay.portal.service.persistence.impl.UserPersistenceImpl.findByPrimaryKey(UserPersistenceImpl.java:8654) ~[portal-impl.jar:?]
      at com.liferay.portal.service.base.UserLocalServiceBaseImpl.getUser(UserLocalServiceBaseImpl.java:351) ~[portal-impl.jar:?]
      at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:66) ~[portal-kernel.jar:?]
      at com.liferay.portal.kernel.service.UserLocalServiceWrapper.getUser(UserLocalServiceWrapper.java:1977) ~[portal-kernel.jar:?]
      at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:66) ~[portal-kernel.jar:?]
      at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:50) ~[portal-impl.jar:?]
      at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:69) ~[portal-impl.jar:?]
      at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:57) ~[portal-impl.jar:?]
      at com.liferay.portal.spring.aop.AopInvocationHandler.invoke(AopInvocationHandler.java:49) ~[portal-impl.jar:?]
      at com.liferay.message.boards.service.impl.MBStatsUserLocalServiceImpl.getUserRank(MBStatsUserLocalServiceImpl.java:241) ~[?:?]
      at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:50) ~[portal-impl.jar:?]
      at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:69) ~[portal-impl.jar:?]
      at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:57) ~[portal-impl.jar:?]
      at com.liferay.portal.spring.aop.AopInvocationHandler.invoke(AopInvocationHandler.java:49) ~[portal-impl.jar:?]
      at com.liferay.message.boards.service.MBStatsUserLocalServiceUtil.getUserRank(MBStatsUserLocalServiceUtil.java:86) ~[bundleFile:?]
      at org.apache.jsp.message_005fboards.view_005fthread_005fmessage_jsp._jspService(view_005fthread_005fmessage_jsp.java:590) ~[?:?]
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111) ~[jasper.jar:9.0.43]
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) ~[servlet-api.jar:4.0.FR]
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411) ~[javax.servlet.jsp-2.3.3-b02.LIFERAY-PATCHED-9.jar:9.0.43]
      18:40
      I'm still working on the first one.  The logs haven't said much with that one yet.
      18:47
      Javier Gamarra 
      I see
      18:47
      Jamie Sammons 
      I'll confirm that one (with a local GDPR test) and then try to figure out what we need to do to fix it.
      18:48
      The other issue is still a mystery to me as I don't see anything wrong with the data as of yet with that one.
      19:32
      Jamie Sammons 
      Still confused on the first issue.  The MB seems to work fine with it.  Enabling Debug I did get a Vulcan error but it didn't make much sense to me:
      vulcan-error.txt 
      2021-08-02 17:16:13.998 DEBUG [http-nio-8080-exec-10][GraphQLServletExtender:1678] java.lang.NoSuchFieldException: this$0
      java.lang.NoSuchFieldException: this$0
      at java.lang.Class.getDeclaredField(Class.java:2070) ~[?:1.8.0_292]
      at com.liferay.portal.vulcan.internal.graphql.servlet.GraphQLServletExtender._getThisField(GraphQLServletExtender.java:1674) ~[bundleFile:?]
      at com.liferay.portal.vulcan.internal.graphql.servlet.GraphQLServletExtender._createObject(GraphQLServletExtender.java:905) ~[bundleFile:?]
      Click to expand inline (230 lines)
       
       
      19:40
      Javier Gamarra 
      strange, those 2 are not a NPE
      19:40
      Jamie Sammons 
      Yeah it didn't make much sense but I'm getting absolutely nothing else out of it for whatever reason.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              luismiguel.barco Luis Miguel Barcos
              Reporter:
              javier.gamarra Javier Gamarra
              Participants of an Issue:
              Recent user:
              Sophia Zhang
              Engineering Assignee:
              Luis Miguel Barcos
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                14 weeks, 1 day ago

                  Packages

                  Version Package
                  7.4.3.4 CE GA4
                  7.4.13 DXP GA1
                  Master