Usernames with Special or Invalid Characters Cannot be Deleted from JIRA

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

When deleting a user via the User Browser, JIRA fails with the following error on the UI:

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:

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:

  1. The database schema is set to UTF-8.
  2. 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.

tip/resting Created with Sketch.

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.


Last modified on Sep 17, 2021

Was this helpful?

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