"User Does not Exist" JQL Exception even when Providing Valid Users
Symptoms
- You perform a search in JQL providing a specific user but it tells that the user does not exist.
- If you append a space in the user name suffix, it works.
- It's possible to see the user at Administration -> User, Groups & Roles -> User Browser.
- You're using external Crowd integration.
- Anything appears in logs.
Cause
In a few upgrade/usage cases, due to unknown reasons, some spaces are inserted in the user name directly on the database. It makes the username unrecognized for the JIRA instance when performing searches.
Resolution
Always back up your data before performing any modification to the database. If possible, try your modifications on a test server.
- Stop JIRA/Crowd.
- Perform the following in both databases.
Run this SQL query to identify which users have invalid names:
select * from cwd_user where length(user_name) != length(trim(user_name));
For MSSQL use the following SQL query:
select * from cwd_user where LEN(user_name) != LEN(RTRIM(LTRIM(user_name)));
Replace the broken names (containing additional space) with the correct ones:
update cwd_user set user_name='user' where user_name='user '; update cwd_membership set child_name='user', lower_child_name='user' where child_name='user ';
- Start JIRA/Crowd and verify if the issue get fixed.