UserAlreadyExistsException thrown during user migration in Jira server
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
The error "User already exists in directory" is thrown when you attempt to migrate users from JIRA Directory to a Delegated Directory.
The following error appears in the atlassian-jira.log
:
1
2
2014-09-23 15:10:34,770 http-bio-8080-exec-14 ERROR admin 910x1748x1 lx1zni 0:0:0:0:0:0:0:1 /plugins/servlet/embedded-crowd/directories/migrate/ [embedded.admin.directory.MigrateDirectoryUsersController] User migration failed
java.lang.RuntimeException: com.atlassian.crowd.exception.UserAlreadyExistsException: User already exists in directory [10002] with name [jira1]
Causes
There is an existing user in the directory. If you check the error message below, jira1 user is exist in Directory ID = 10002.
1
User already exists in directory [10002] with name [jira1]
Diagnosis
If you would like to know which users are not migrated to the Directory, you can run the following SQL query and check the returned results:
1
select directory_id, lower_user_name, active from cwd_user where directory_id = '<directory_id>' AND lower_user_name not in (select lower_user_name from cwd_user where directory_id = '<destination>');
ℹ️ Replace <directory_id> and <destination> accordingly.
Resolution
If the user does not exist in the directory, you can refer the following resolution steps:
Disable the current failing delegated ldap directory.
Create a new Internal With LDAP Authentication directory and leave the option Copy User on Login disabled for the moment. If needed you can go back and re-enable the copy option once this is complete.
Move the newly created directory to the top of the directory list.
Complete your migration.
Managing 500+ users across Atlassian products?
Find out how easy, scalable and effective it can be with Crowd!
See
.
Was this helpful?