Unable to remove users from Project role

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

 

 

Problem

Unable to remove user from any project. When another user tried to delete the affected user, JIRA will momentarily refresh itself but the user will not be removed. There will not be any error logged in logs and also in browser console.

 

Diagnosis

Check from projectroleactorapp_user and cwd_user tables from JIRA's database to see whether the username contains any whitespace. Eg: <'test.user '>. We can search for the affected user from JIRA's database using the similar SQL query shown below:

 

select * from app_user where user_key like '% '

 

 

If the XML backup is available, we can extract the backup and run the grep command below:

 

grep "\"username \"" *

 

Cause

This problem is caused by by the user with spaces but only in the user_key in the app_user table. Basically, instead of saving entry of <'test.user'>, the username is stored as <'test.user '>..

 

Resolution

To fix this problem , we'll have to update the username was stored as <'test.user '> to <'test.user'> from database. From the grep command earlier, we can get all the tables where the username was stored as <'test.user '> to <'test.user'>. Based on the information, we can run the following SQL query:

 

 Please backup your JIRA before applying the solution.

1. Stop your JIRA.
2. Run all the SQL queries below to update the <'test.user '> to <'test.user'>;

update app_user set user_key = 'test.user' where user_key = 'test.user ';


3. Restart your JIRA and re-index it.

 

If the username with whitespace is shown in other tables, update those entries from database as well.

Last modified on Mar 6, 2017

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.