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

Unable to modify group memberships for re-created users

      NOTE: This bug report is for JIRA Server. Using JIRA Cloud? See the corresponding bug report.

      Using standalone Crowd as an external directory (internal directory disabled):

      • create a user (the 'original' user),
      • add the user to some groups,
      • delete the user,
      • create a new user with same username,
      • remove them from all groups,
      • restart JIRA.

      After JIRA restarts, the user will be in all the groups the original user was in, and it will be impossible to remove them from any of these groups.

            [JRASERVER-25611] Unable to modify group memberships for re-created users

            @Michael Knight: What is the risk involved in running the cleanup query without shutting down JIRA?

            Nagarajan Gopalan added a comment - @Michael Knight: What is the risk involved in running the cleanup query without shutting down JIRA?

            Uwe Schindler added a comment - - edited

            In my JIRA database I had similar problem (because the fix in this issue only prevented the creation of the junk). Interestingly, we migrated the database from mysql to postgresql through JIRA's backup/restore, but the junk entries survived this.

            I was able to delete the junk entries (before that I checked with a select, what I would delete – and it actually showed the broken users). After executing the delete statement and restarting JIRA, all was fixed. Check for incorrect entries:

            select * from cwd_membership where child_id not in (select id from cwd_user);
            

            This should show the affected users and groups together with other information.

            Nevertheless, wouldn't it be a good idea to add the above check to the database integrity check available from the JIRA admin GUI?

            Uwe Schindler added a comment - - edited In my JIRA database I had similar problem (because the fix in this issue only prevented the creation of the junk). Interestingly, we migrated the database from mysql to postgresql through JIRA's backup/restore, but the junk entries survived this. I was able to delete the junk entries (before that I checked with a select, what I would delete – and it actually showed the broken users). After executing the delete statement and restarting JIRA, all was fixed. Check for incorrect entries: select * from cwd_membership where child_id not in ( select id from cwd_user); This should show the affected users and groups together with other information. Nevertheless, wouldn't it be a good idea to add the above check to the database integrity check available from the JIRA admin GUI?

            Were you ever running on a version of JIRA < 4.4.2? If so, re-created users will have left junk in the database that will not be fixed up without manual intervention. This fix only stopped the junk from being created, it didn't clean up the old junk.

            To clean up the old junk:

            1. shut down JIRA,
            2. back up your JIRA database,
            3. run the following SQL query:
              delete from cwd_membership where child_id not in (select id from cwd_user);
            4. start JIRA.

            You should now be able to modify group memberships for the affected user.

            Michael Knight added a comment - Were you ever running on a version of JIRA < 4.4.2? If so, re-created users will have left junk in the database that will not be fixed up without manual intervention. This fix only stopped the junk from being created, it didn't clean up the old junk. To clean up the old junk: shut down JIRA, back up your JIRA database, run the following SQL query: delete from cwd_membership where child_id not in ( select id from cwd_user); start JIRA. You should now be able to modify group memberships for the affected user.

            We're using v5.1.8#787 and are facing the same trouble. This is not fixed.
            https://answers.atlassian.com/questions/94209/unable-to-remove-a-user-from-jira-administrators

            Nabil Sayegh added a comment - We're using v5.1.8#787 and are facing the same trouble. This is not fixed. https://answers.atlassian.com/questions/94209/unable-to-remove-a-user-from-jira-administrators

            Originally discovered in Studio: https://studio.atlassian.com/browse/JST-5529

            Michael Knight added a comment - Originally discovered in Studio: https://studio.atlassian.com/browse/JST-5529

              andreask@atlassian.com Andreas Knecht (Inactive)
              mknight@atlassian.com Michael Knight
              Affected customers:
              1 This affects my team
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: