Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-33974

Deleted LDAP user can cause NPE when using mentions

    XMLWordPrintable

Details

    Description

      The problem

      On a Confluence instance using an external user directory deleted users can cause the mentions feature to log NPEs, and stop sending notifications.

      The root cause is that DefaultFollowManager.getFollowers() is missing a null check. It should be checking that follower is not null, similar to the check in the getFollowing() method.

      The following NullPointerException is thrown on the logs:

      2014-06-13 11:12:26,166 ERROR [http-bio-8552-exec-4] [common.error.jersey.ThrowableExceptionMapper] toResponse Uncaught exception thrown by REST service: null
       -- referer: http:/localhost:8080/confluence/pages/editpage.action?pageId=917517 | url: /confluence/rest/mentions/1/network.json | userName: admin
      java.lang.NullPointerException
      	at com.atlassian.confluence.user.persistence.dao.CachingPersonalInformationDao.getByUser(CachingPersonalInformationDao.java:34)
      ...
      

      Workaround

      Manually deleting the old references from the FOLLOW_CONNECTIONS table. This can be done with the following SQL statement:

      delete from follow_connections where follower in (select user_key from user_mapping where lower_username not in (select lower_user_name from cwd_user))
      

      Make sure to create a database backup before any modification.
      Confluence will need to be restarted after remove those entries from the database.

      Attachments

        Activity

          People

            merickson Matthew Erickson
            merickson Matthew Erickson
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: