-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Low
-
None
-
Affects Version/s: 9.4.6
-
Component/s: User Management - Others
-
None
-
9.04
-
2
-
Severity 3 - Minor
-
0
Issue Summary
As seen in the documentation, when migrating users from one directory to another and duplicates are seen, the documentation indicates the user will be skipped:
Users and groups will not be migrated if they already exist in the target directory. For example, consider a user that exists in Jira Internal and Jira Delegated LDAP but has different groups in Jira Internal: when migrating from Jira Internal to the Jira Delegated LDAP, that user will be skipped and the groups will not be migrated.
However, when duplicates are seen, an error is thrown in UI and no user is migrated.
This is reproducible on Data Center: yes
Steps to Reproduce
- Create two or more user directories that can be migrated (as one internal and one delegated or two delegated).
- Create some users in one directory.
- Create some users in the second directory (or migrate users to the second, so they will be duplicated on it)
- Migrate users from the second directory to the first.
Expected Results
All non-duplicate users will be migrated.
Actual Results
An error is thrown and no user user is migrated:
Directory migration failed. Error message: com.atlassian.crowd.exception.UserAlreadyExistsException: User already exists in directory [10100] with name [jtester]
And in the atlassian.jira.log:
2023-11-21 10:20:52,719-0300 http-nio-8080-exec-10 ERROR dalves 620x2905x1 2cgvjx 0:0:0:0:0:0:0:1 /plugins/servlet/embedded-crowd/directories/migrate/ [c.a.c.e.admin.directory.MigrateDirectoryUsersController] User migration failed java.lang.RuntimeException: com.atlassian.crowd.exception.UserAlreadyExistsException: User already exists in directory [10100] with name [jtester] at com.atlassian.crowd.embedded.admin.directory.MigrateDirectoryUsersController$1.doInTransaction(MigrateDirectoryUsersController.java:153) at com.atlassian.sal.core.transaction.HostContextTransactionTemplate$1.doInTransaction(HostContextTransactionTemplate.java:21) ... Caused by: com.atlassian.crowd.exception.UserAlreadyExistsException: User already exists in directory [10100] with name [jtester] at com.atlassian.crowd.manager.directory.DirectoryManagerGeneric.addUser(DirectoryManagerGeneric.java:341) at com.atlassian.crowd.manager.directory.DirectoryManagerGeneric.addUser(DirectoryManagerGeneric.java:334) ... 344 more
Workaround
Disable the duplicate by changing the directory order and deleting the duplicated user in the target directory. After that, try to migrate the directories again.