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

User Loses all Local Group Memberships If Any of the LDAP Syncs Is Unable to Find the User, Even If the User Appears After Subsequent Syncs

      I can't think of a better title, but the steps to reproduce should explain this behavior:

      1. Create a connection to Active Directory via JIRA Administration >> User Directories, using Read Only with Local Groups.
      2. Sync all users from AD , set Default Group Memberships to jira-users and jira-internal
      3. Login using a testADuser
      4. Notice that testADuser is automatically added to the groups jira-users and jira-internal
      5. Logout and login again as admin, this time, change the user object filter in the AD Directory to this:
        (&(objectCategory=Person)(!(sAMAccountName=testADuser)))
        
      6. Sync the directory. Notice that testADuser is not synchronized.
      7. Change the user object filter back to:
        (&(objectCategory=Person)(sAMAccountName=*))
        
      8. Sync the directory again, notice that testADuser is synced back, but the user is no longer in jira-users and jira-internal. In this sense, the user indeed, loses all group memberships if they are filtered out from an Active Directory sync (could be due to a failure in any of the Active Directory trees)

      Suggestion

      Instead of using a regular Active Directory Connector with Local Groups, Consider using Internal with LDAP Authentication (Delegated) Directory instead.

            [JRASERVER-29293] User Loses all Local Group Memberships If Any of the LDAP Syncs Is Unable to Find the User, Even If the User Appears After Subsequent Syncs

            Teja added a comment -

            @Brennan Norwood

            You've just saved me such a headache by forcing full sync rather than incremental, thank you!

            Teja added a comment - @Brennan Norwood You've just saved me such a headache by forcing full sync rather than incremental, thank you!

            neoa added a comment -

            Hi aaragon1349470489,

            All of the groups were imported from LDAP. I completely agree that the mismatch should disappear, but it wasn't until disabling the incremental sync as I mentioned above. It was broken for a number of days while I searched for an answer, and as soon as a Full Sync ran instead of the incremental one, the problem was gone.

            neoa added a comment - Hi aaragon1349470489 , All of the groups were imported from LDAP. I completely agree that the mismatch should disappear, but it wasn't until disabling the incremental sync as I mentioned above. It was broken for a number of days while I searched for an answer, and as soon as a Full Sync ran instead of the incremental one, the problem was gone.

            Hi @Brennan Norwood!

            Are some of them local groups? Or all of your groups are imported from the LDAP.

            I think the problem appears only with local groups. It stands to reason that if all groups are imported from ldap, the mismatch will disappear using full sync.

            Alberto Aragón added a comment - Hi @Brennan Norwood! Are some of them local groups ? Or all of your groups are imported from the LDAP. I think the problem appears only with local groups. It stands to reason that if all groups are imported from ldap, the mismatch will disappear using full sync.

            For anyone who is still experiencing this issue, we were able to resolve this by disabling the Incremental Sync option in the Active Directory sync settings. Doing this triggered a full sync instead of an incremental sync, and the group memberships for the users which were having the problem re-appeared. 

            We have a fairly small organization (~200 Users), so we made the decision to leave the incremental sync off as it took no more time to complete. In theory you should be able to re-enable it after the full sync, and it would be happy again.

            Brennan Norwood added a comment - For anyone who is still experiencing this issue, we were able to resolve this by disabling the Incremental Sync option in the Active Directory sync settings. Doing this triggered a full sync instead of an incremental sync, and the group memberships for the users which were having the problem re-appeared.  We have a fairly small organization (~200 Users), so we made the decision to leave the incremental sync off as it took no more time to complete. In theory you should be able to re-enable it after the full sync, and it would be happy again.

            ENG SCM added a comment -

            Dear Atlassian,
            Why is this marked as Won't Fix ? We had a situation where the AD group had to be moved to different OU. This caused the user group information to be lost.

            ENG SCM added a comment - Dear Atlassian, Why is this marked as Won't Fix ? We had a situation where the AD group had to be moved to different OU. This caused the user group information to be lost.

            Dennis added a comment -

            we are currently experiencing same odd problems
            There was a problem with our LDAP Servers, one or two of the LDAP knots went down (3 Servers behind 1 Load Balancer), so we had to connect the systems to a special LDAP knot (instead of the LDAP Load Balancer) afterwards, most users lost their local group memberships in confluence, jira and stash as well.
            We have approx >20k Users on our systems thus we need a solution for the future, that if a user is not found by the LDAP Connector the Atlassian Application must not delete the Group Memberships. Something like a deactivation or a checkbox like "in case of LDAP connection loss do not delete group memberships".
            We now have loads of User Tickets caused by access problems/ missing group memberships - this is definetely not enterprise like -
            Out SAP Netweaver Portal for example, was affected by the LDAP server dowtime as well, so we did the same workaround : creating a new LDAP connection the only LDAP knot that has kept running - and no one loses their group memberships.

            Dennis added a comment - we are currently experiencing same odd problems There was a problem with our LDAP Servers, one or two of the LDAP knots went down (3 Servers behind 1 Load Balancer), so we had to connect the systems to a special LDAP knot (instead of the LDAP Load Balancer) afterwards, most users lost their local group memberships in confluence, jira and stash as well. We have approx >20k Users on our systems thus we need a solution for the future, that if a user is not found by the LDAP Connector the Atlassian Application must not delete the Group Memberships. Something like a deactivation or a checkbox like "in case of LDAP connection loss do not delete group memberships". We now have loads of User Tickets caused by access problems/ missing group memberships - this is definetely not enterprise like - Out SAP Netweaver Portal for example, was affected by the LDAP server dowtime as well, so we did the same workaround : creating a new LDAP connection the only LDAP knot that has kept running - and no one loses their group memberships.

            I think that a much better approach in this case would be to just disable the missing user, without trying to remove it.

            On real production systems with big directories (>5.000 users), this may happen more often than you may think.

            Sorin Sbarnea added a comment - I think that a much better approach in this case would be to just disable the missing user, without trying to remove it. On real production systems with big directories (>5.000 users), this may happen more often than you may think.

            ChrisA added a comment -

            When deleting a user from the directory, we remove their group memberships as well. This stops orphan data from being left around and stops users inheriting old group memberships upon being re-added (See https://jira.atlassian.com/browse/JRA-25611 for a resolved bug related to this as well).

            We feel it's better to have a user decrease permissions than incorrectly inherit elevated permissions. Additionally it seems likely that if a user is disappearing from a remote directory, there is a larger problem at play beyond JIRA.

            ChrisA added a comment - When deleting a user from the directory, we remove their group memberships as well. This stops orphan data from being left around and stops users inheriting old group memberships upon being re-added (See https://jira.atlassian.com/browse/JRA-25611 for a resolved bug related to this as well). We feel it's better to have a user decrease permissions than incorrectly inherit elevated permissions. Additionally it seems likely that if a user is disappearing from a remote directory, there is a larger problem at play beyond JIRA.

              Unassigned Unassigned
              fsim Foo Sim (Inactive)
              Affected customers:
              3 This affects my team
              Watchers:
              12 Start watching this issue

                Created:
                Updated:
                Resolved: