-
Bug
-
Resolution: Fixed
-
Low
-
6.6.1, 6.8.2, 6.9.1
-
5
-
Severity 3 - Minor
-
Issue Summary
When upgrade from Bamboo 6.5.x or older to Bamboo 6.6.x or later, it fail with "Group already exists in the Remote Directory" when there is a LDAP user that is assigned with a local group membership and the same membership exist in LDAP server
Steps to Reproduce
- Install Bamboo 6.5.x
- Create a user "test" in LDAP server
- Configure LDAP repository
- From Bamboo Administration, edit the LDAP user "test" to assign it to the local Bamboo group "bamboo-admin"
- Create a group "bamboo-admin" in LDAP server
- Assign LDAP user to the group "bamboo-admin" in LDAP server
No error in Bamboo - Upgrade Bamboo to version 6.6.x
Expected Results
Upgrade is successful
Actual Results
Upgrade fail with the below exception is thrown in the atlassian-bamboo.log file:
2019-06-21 18:18:09,977 INFO [17-UpgradeTaskBackgroundThread:pool-31-thread-1] [AbstractUpgradeManager] 60602 : Move users to Embedded Crowd (post-bootstrap) 2019-06-21 18:18:09,977 INFO [17-UpgradeTaskBackgroundThread:pool-31-thread-1] [AbstractUpgradeManager] ----------------------------------------------------- 2019-06-21 18:18:10,152 INFO [17-UpgradeTaskBackgroundThread:pool-31-thread-1] [AtlassianUserDataMigrator] Copying 2 groups... 2019-06-21 18:18:10,170 INFO [17-UpgradeTaskBackgroundThread:pool-31-thread-1] [UpgradeTask60602MoveUsersToEmbeddedCrowd] Migration of groups took 118.7 ms 2019-06-21 18:18:10,170 INFO [17-UpgradeTaskBackgroundThread:pool-31-thread-1] [AtlassianUserDataMigrator] Copying 2 users... 2019-06-21 18:18:10,193 INFO [17-UpgradeTaskBackgroundThread:pool-31-thread-1] [UpgradeTask60602MoveUsersToEmbeddedCrowd] Migration of users took 23.45 ms 2019-06-21 18:18:10,196 INFO [17-UpgradeTaskBackgroundThread:pool-31-thread-1] [AtlassianUserDataMigrator] Upgrading external membership information using data from the database 2019-06-21 18:18:10,197 INFO [17-UpgradeTaskBackgroundThread:pool-31-thread-1] [AtlassianUserDataMigrator] Copying 1 local memberships of LDAP users... 2019-06-21 18:18:10,445 WARN [17-UpgradeTaskBackgroundThread:pool-31-thread-1] [AtlassianUserDataMigrator] User not found in local repository. It might be available at external repository, creating user placeholder to be filled by Crowd on LDAP synchronization. User name: [test], group name: [bamboo-admin] 2019-06-21 18:18:10,569 ERROR [17-UpgradeTaskBackgroundThread:pool-31-thread-1] [AbstractUpgradeManager] com.atlassian.crowd.exception.runtime.OperationFailedException: com.atlassian.crowd.exception.InvalidGroupException: Group already exists in the Remote Directory com.atlassian.crowd.exception.runtime.OperationFailedException: com.atlassian.crowd.exception.InvalidGroupException: Group already exists in the Remote Directory at com.atlassian.crowd.embedded.core.CrowdServiceImpl.addUserToGroup(CrowdServiceImpl.java:557) at com.atlassian.bamboo.upgrade.tasks.v6_6.ec.AtlassianUserDataMigrator.migrateMembershipInLocalGroup(AtlassianUserDataMigrator.java:389) at com.atlassian.bamboo.upgrade.tasks.v6_6.ec.AtlassianUserDataMigrator.access$400(AtlassianUserDataMigrator.java:71) at com.atlassian.bamboo.upgrade.tasks.v6_6.ec.AtlassianUserDataMigrator$4.processRowInternal(AtlassianUserDataMigrator.java:359) at com.atlassian.bamboo.upgrade.tasks.v6_6.ec.SessionClearingRowCallbackHandler.processRow(SessionClearingRowCallbackHandler.java:36) at org.springframework.jdbc.core.JdbcTemplate$RowCallbackHandlerResultSetExtractor.extractData(JdbcTemplate.java:1566)
Notes
Even though there is duplicate membership setting, Bamboo should skip the migration for duplicate membership instead of failing the upgrade
Workaround
- Check the membership data in database:
SELECT em.EXTENTITYID, ee.NAME, em.GROUPID, g.GROUPNAME FROM EXTERNAL_MEMBERS em JOIN EXTERNAL_ENTITIES ee ON em.EXTENTITYID=ee.ID JOIN GROUPS g ON em.GROUPID=g.ID;
- Compare it with LDAP server
- If there is any duplicate membership with LDAP server, delete it in the table EXTERNAL_MEMBERS
DELETE FROM EXTERNAL_MEMBERS WHERE EXTENTITYID=<userID> AND GROUPID=<groupID>;
- is cloned as
-
BDEV-15447 Loading...
[BAM-20493] Upgrade fail with Group already exists in the Remote Directory
Fix Version/s | New: 6.10.2 [ 89592 ] | |
Fix Version/s | Original: 6.9.3 [ 88390 ] |
Workflow | Original: Bamboo Workflow 2016 v1 - Restricted [ 3244751 ] | New: JAC Bug Workflow v3 [ 3386119 ] |
Status | Original: Resolved [ 5 ] | New: Closed [ 6 ] |
Resolution | New: Fixed [ 1 ] | |
Status | Original: Open [ 1 ] | New: Resolved [ 5 ] |
Fix Version/s | New: 6.9.3 [ 88390 ] |
Assignee | New: Marcin Gardias [ mgardias ] |
Component/s | New: Upgrading [ 11560 ] |
Component/s | New: User Management, Crowd & LDAP integration [ 11830 ] | |
Occurrence Factor | New: 10% [ 12830 ] | |
Status | Original: Needs Triage [ 10030 ] | New: Open [ 1 ] |
Remote Link | New: This issue links to "BDEV-15447 (Jira)" [ 432645 ] |
Labels | New: bamboo-bugfix-kanban |
Support reference count | New: 5 |