Usernames with Special or Invalid Characters Cannot be Deleted from JIRA
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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
Symptoms
When deleting a user via the User Browser, JIRA fails with the following error on the UI:
1
User XXXXX does not exist please select a user from the User Browser
Cause
There are two possible causes:
1. JIRA encoding is not configured correctly.
2. The username contains invalid characters. Sometimes usernames may contain newline characters or other types of escape characters that can not be parsed correctly. (e.g. the username appears in two lines in the JIRA database)
Diagnose
Compare the lower_user_name column in app_user and cwd_user table by using the following SQL query:
1
2
3
select * from app_user where lower_user_name like '%affected_username%';
select user_name, lower_user_name from cwd_user where lower_user_name like '%affected_username%';
Ensure the lower_user_name on both table are the same.
Resolution
Resolution for Cause #1: JIRA encoding is not configured correctly
Ensure that:
The database schema is set to UTF-8.
The useBodyEncodingForURI is set to true in your Tomcat's server.xml file as per this document.
Resolution for Cause #2: Username contains invalid characters
A. If the username is from the JIRA internal directory
Try to rename the user from the JIRA UI first to remove the invalid character, as per described here: How to rename users in JIRA 6.0+ in internal directory with LDAP authentication If this fails, then the username must be renamed from the JIRA database instead. This can be very complicated because many tables refer to the username directly. Please contact Atlassian Support directly for further assistance on how to do this.
Alternatively, you can also try deactivating the user in the UI so that the account will be inactive. Please refer to this documentation for deactivating a user: Invite a user.
B. If the username is from LDAP
Try renaming the user from the LDAP side, and then syncing it again for JIRA to pick up the changes.
We recommend testing this in a test environment first before trying it out in Production.
If this does not work or a new user is created instead of the rename kicking in, please contact Atlassian Support for further assistance.
Was this helpful?