Uploaded image for project: 'Confluence Cloud'
  1. Confluence Cloud
  2. CONFCLOUD-54224

Notifications for users which no longer exist are preventing page operations

    XMLWordPrintable

Details

    Description

      This is typically occurring after an import and is due to the users being notified by a change not existing, causing a NullPointerException and a transaction rollback.

      In OnDemand, it is reportedly caused by a deletion of user through JIRA OnDemand, which triggers deletion of the user in Confluence OnDemand. In Confluence watch list, this user is listed as undefined ().

      We have seen this occur for page saves, page moves, page deletion and comment saving.

      The stack trace is typically like this -

       java.lang.NullPointerException
             at com.atlassian.crowd.embedded.core.CrowdServiceImpl.isUserDirectGroupMember(CrowdServiceImpl.java:828)
             at com.atlassian.studio.confluence.PartiallyFilteredCrowdServiceImpl.isUserDirectGroupMember(PartiallyFilteredCrowdServiceImpl.java:50)
             at com.atlassian.studio.confluence.OnDemandLicenseManagerImpl.hasLicensedAccess(OnDemandLicenseManagerImpl.java:69)
             at com.atlassian.confluence.security.DefaultPermissionManager.canUseConfluence(DefaultPermissionManager.java:107)
             at com.atlassian.confluence.security.DefaultPermissionManager.hasPermissionNoExemptions(DefaultPermissionManager.java:60)
             at sun.reflect.GeneratedMethodAccessor2232.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:597)
             at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
             at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
             at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
             at com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:16)
             at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
             at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
             at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
             at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
             at $Proxy45.hasPermissionNoExemptions(Unknown Source)
             at com.atlassian.confluence.mail.notification.DefaultNotificationsSender.isPermittedRecipient(DefaultNotificationsSender.java:300)
             at com.atlassian.confluence.mail.notification.DefaultNotificationsSender.isValidUser(DefaultNotificationsSender.java:289)
             at com.atlassian.confluence.mail.notification.DefaultNotificationsSender.access$100(DefaultNotificationsSender.java:49)
             at com.atlassian.confluence.mail.notification.DefaultNotificationsSender$1.call(DefaultNotificationsSender.java:139)
             at com.atlassian.confluence.mail.notification.DefaultNotificationsSender$1.call(DefaultNotificationsSender.java:132)
             at com.atlassian.confluence.user.AuthenticatedUserImpersonator$2.call(AuthenticatedUserImpersonator.java:134)
             at com.atlassian.confluence.user.AuthenticatedUserImpersonator$1.call(AuthenticatedUserImpersonator.java:113)
             at com.atlassian.confluence.user.AuthenticatedUserImpersonator.asUser(AuthenticatedUserImpersonator.java:89)
             at com.atlassian.confluence.mail.notification.DefaultNotificationsSender.sendNotification(DefaultNotificationsSender.java:131)
             at com.atlassian.confluence.mail.notification.DefaultNotificationsSender.sendNotification(DefaultNotificationsSender.java:110)
             at com.atlassian.confluence.mail.notification.DefaultNotificationsSender.sendNotifications(DefaultNotificationsSender.java:264)
             at com.atlassian.confluence.mail.notification.DefaultNotificationsSender.sendPageNotifications(DefaultNotificationsSender.java:235)
             at com.atlassian.confluence.mail.notification.listeners.PageNotificationsListener.handleEvent(PageNotificationsListener.java:139)
             at com.atlassian.event.legacy.LegacyListenerHandler$LegacyListenerInvoker.invoke(LegacyListenerHandler.java:55)
             at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$2.run(AsynchronousAbleEventDispatcher.java:66)
             at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1.execute(AsynchronousAbleEventDispatcher.java:32)
             at com.atlassian.event.internal.EventPublisherImpl.invokeListeners(EventPublisherImpl.java:160)
             at com.atlassian.event.internal.EventPublisherImpl.publish(EventPublisherImpl.java:79)
             at com.atlassian.event.legacy.LegacyEventManager.publishEvent(LegacyEventManager.java:36)
             at com.atlassian.confluence.event.ConfluenceEventManager.publishEvent(ConfluenceEventManager.java:47)
             at sun.reflect.GeneratedMethodAccessor182.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:597)
             at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
             at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
             at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
             at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
             at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
             at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
             at $Proxy18.publishEvent(Unknown Source)
             at com.atlassian.confluence.pages.DefaultPageManager.publishUpdateEvent(DefaultPageManager.java:918)
             at com.atlassian.confluence.core.DefaultContentEntityManager.saveContentEntity(DefaultContentEntityManager.java:87)
             at com.atlassian.confluence.pages.DefaultPageManager.saveContentEntity(DefaultPageManager.java:858)
             at sun.reflect.GeneratedMethodAccessor2400.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:597)
             at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
             at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
             at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
             at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
             at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
             at com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:16)
             at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
             at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
             at $Proxy57.saveContentEntity(Unknown Source)
             at com.atlassian.confluence.pages.actions.AbstractEditPageAction.doSaveEditPageBean(AbstractEditPageAction.java:187)
             at com.atlassian.confluence.pages.actions.EditPageAction.doSaveEditPageBean(EditPageAction.java:150)
             at com.atlassian.confluence.pages.actions.EditPageAction.doEdit(EditPageAction.java:229)
             at sun.reflect.GeneratedMethodAccessor4066.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:597)
      

      Workaround

      As a space administrator, remove the invalid user from the watchers list. See screenshot:

      This workaround doesn't work for me every time, the deleted watcher will disappear then reappear if I refresh the page. Here's the database queries to take care of it:

      select username from user_mapping where user_key in (select username from notifications where contentid = <YOURPAGEIDHERE>);
      Hit edit on the page to get this, alternatively if the deleted user is watching the entire space sub the last part for spaceid = <YOURSPACEIDHERE>
      

      With that statement pulled up you can compare to the watchers list on the page. Find the one that's in the SQL but not on the page, that's your culprit.

      select user_key from user_mapping where username = '<YOURUSERNAMEHERE>';
      ** This is the culprit username that doesn't match
      

      If you haven't already make a backup of your connie DB

      delete from notifications where username = '<YOURUSERKEYHERE>';
      ** The user key from the above statement
      

      This will also fix the problem for any other pages not that has that deleted user as a watcher

      Attachments

        Issue Links

          Activity

            People

              onevalainen Olli Nevalainen
              pcurren Paul Curren
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: