Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-70842

Deleting a user from LDAP or Crowd server will not delete this user from the projectroleactor table

    XMLWordPrintable

Details

    Description

      Summary:

      When a user is deleted from an external directory (LDAP or external Crowd server), references to this user will retain in the projectroleactor table.

      Steps to Reproduce:

      1. Configure an external directory in Jira via the page ⚙ > User Management > User Directories (with an LDAP or Crowd server)
      2. Add a user to the LDAP (or Crowd) server (username: chibi6)
      3. Sync Jira with the LDAP (or Crowd) server
      4. Add that user to a Project Role in any Jira project
      5. Delete the user from the LDAP (or Crowd) server
      6. Sync again Jira with the LDAP (or Crowd) server
      7. Go to the ⚙ > User Management > Users page, and verify that the user is no longer there
      8. Go to the Project Role page and verify that the user is not displayed there:
      9. Run the following SQL query and verify that the user has been deleted from the cwd_user table
        select id, directory_id, user_name, active from cwd_user where user_name = 'chibi6';
        

      10. Run the following SQL query:
        select * from projectroleactor where roletypeparameter = 'chibi6';
        

      Expected Results:

      The user is deleted from the projectroleactor table.

      Actual Results:

      The user is not deleted from this table, even though the user is not showing in the Project Role in the UI, causing some data discrepancy in the database:

      Workaround

      The only workaround to avoid this discrepancy is to manually delete the rows from the projectroleactor table for the user(s) that have been deleted from the LDAP (or Crowd) server.

      If you decide to go ahead with this workaround, make sure to create a native backup of your Jira Database, so that you can revert the changes if anything goes wrong.

      Notes

      Note 1
      This bug does not occur when a user is deleted from the Jira Internal Directory. In this case, when the user is deleted from this directory via the page ⚙ > User Management > Users (or from the Jira API via the end point api/2/user), the user is properly deleted from the projectroleactor table.

      Note 2

      This bug was reproduced in Jira versions 8.4.2 and 8.7.1, but it is likely that this bug has been there for a while in older versions (such as 7.x)

      Attachments

        1. Screenshot1.png
          Screenshot1.png
          89 kB
        2. Screenshot2.png
          Screenshot2.png
          48 kB
        3. Screenshot3.png
          Screenshot3.png
          57 kB

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jrey Julien Rey
              Votes:
              18 Vote for this issue
              Watchers:
              23 Start watching this issue

              Dates

                Created:
                Updated: