Uploaded image for project: 'Jira Platform Cloud'
  1. Jira Platform Cloud
  2. JRACLOUD-79417

Jira Site Import hits into duplicate Group exception

XMLWordPrintable

      Summary

      When restoring a Cloud backup on another Jira Cloud site, the import fails with the following message:

      "Error importing data: cloud.atlassian.logmon.laas.api.PrivacySafeException: Privacy-safe boxing of a com.atlassian.crowd.exception.runtime.OperationFailedException"

      On the backend, however, we can see an exception "GroupAlreadyExists", status 409 meaning there is a conflict of information.

      Environment

      • Cloud -> Cloud restoration

      Steps to Reproduce

      1. Take a backup of a Jira Cloud
      2. Restore it on another Cloud

      Expected Results

      Restoration completes successfully.

      Actual Results

      It shows error:

      "Error importing data: cloud.atlassian.logmon.laas.api.PrivacySafeException: Privacy-safe boxing of a com.atlassian.crowd.exception.runtime.OperationFailedException"
      

      Application logs:

      com.atlassian.idp.client.exceptions.GroupAlreadyExistsException: {"schemas":["urn:ietf:params:scim:api:messages:2.0:Error"],"status":"409","scimType":"uniqueness","detail":"A group with Group_groupname already exists","errorType":"GroupAlreadyExists","message":"A group with Group_groupname already exists","data":"Group_groupname"}
      stack: com.atlassian.crowd.exception.runtime.OperationFailedException: com.atlassian.idp.client.exceptions.GroupAlreadyExistsException: {"schemas":["urn:ietf:params:scim:api:messages:2.0:Error"],"status":"409","scimType":"uniqueness","detail":"A group with Group_groupname already exists","errorType":"GroupAlreadyExists","message":"A group with Group_groupname already exists","data":"Group_groupname"}
      com.atlassian.crowd.embedded.core.CrowdServiceImpl.addGroup(CrowdServiceImpl.java:704)
      com.atlassian.crowd.embedded.core.DelegatingCrowdService.addGroup(DelegatingCrowdService.java:233)
      com.atlassian.crowd.embedded.core.FilteredCrowdServiceImpl.addGroup(FilteredCrowdServiceImpl.java:276)
      com.atlassian.jira.bc.dataimport.identity.GroupsOperations.transferGroupsToCrowd(GroupsOperations.java:78)
      com.atlassian.jira.bc.dataimport.identity.IdentityImportHelper.performMigration(IdentityImportHelper.java:144)
      com.atlassian.jira.bc.dataimport.CloudImportTaskRunner.performTasksOnImportDb(CloudImportTaskRunner.java:426)
      com.atlassian.jira.bc.dataimport.CloudImportTaskRunner.performTasksOnImportDb(CloudImportTaskRunner.java:529)
      com.atlassian.jira.bc.dataimport.CloudImportTaskRunner.lambda$null$1(CloudImportTaskRunner.java:244)
      com.atlassian.connpool.impl.AbstractConnectionPoolProvider.withPrivatePool(AbstractConnectionPoolProvider.java:130)
      com.atlassian.jira.connpool.JiraViburConnectionPoolProvider.withPrivatePool(JiraViburConnectionPoolProvider.java:148)
      com.atlassian.jira.bc.dataimport.AbstractBackupTaskRunner.lambda$null$0(AbstractBackupTaskRunner.java:63)
      	at java.util.Optional.map(Optional.java:215)
      com.atlassian.jira.bc.dataimport.AbstractBackupTaskRunner.lambda$runWithSeparateContextAsync$1(AbstractBackupTaskRunner.java:62)
      java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)
      java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: com.atlassian.idp.client.exceptions.GroupAlreadyExistsException: {"schemas":["urn:ietf:params:scim:api:messages:2.0:Error"],"status":"409","scimType":"uniqueness","detail":"A group with Group_groupname already exists","errorType":"GroupAlreadyExists","message":"A group with Group_groupname already exists","data":"Group_groupname"}
      com.atlassian.idp.client.IdentityPlatformClientImpl.mapStatusCodeException(IdentityPlatformClientImpl.java:702)
      com.atlassian.idp.client.IdentityPlatformClientImpl.mapInputStream(IdentityPlatformClientImpl.java:621)
      com.atlassian.idp.client.IdentityPlatformClientImpl.makeRequestWithEntityBody(IdentityPlatformClientImpl.java:595)
      com.atlassian.idp.client.IdentityPlatformClientImpl.createGroup(IdentityPlatformClientImpl.java:473)
      com.atlassian.crowd.directory.IdentityPlatformRemoteDirectory.addGroup(IdentityPlatformRemoteDirectory.java:508)
      com.atlassian.crowd.directory.DbCachingRemoteDirectory.addGroup(DbCachingRemoteDirectory.java:1357)
      com.atlassian.crowd.manager.directory.DirectoryManagerGeneric.addGroup(DirectoryManagerGeneric.java:552)
      com.atlassian.crowd.manager.application.ApplicationServiceGeneric.addGroup(ApplicationServiceGeneric.java:1075)
      com.atlassian.crowd.embedded.core.CrowdServiceImpl.addGroup(CrowdServiceImpl.java:698)
      

      Notes

      • The bug most likely to happen on Cloud -> Cloud restoration
      • The error message can have other causes.

      Workaround

      1. Remove users and groups from the entities.xml and import with one of the following options:
        Please make a backup/copy of the Import File before performing any changes to it
        Once that is done, please run one of the following blocks at the OS Level (preferably through a Linux Terminal) the below SED commands against the XML file:
        sed -i '/<User id="/d' entities.xml
        sed -i '/<Group id="/d' entities.xml
        sed -i '/<Membership id="/d' entities.xml
        sed -i '/<GroupAttribute id="/d' entities.xml
        

        In case you are using MacOS, the below SED syntax is more suitable for the MacOS Terminal:

        sed -i '' '/<User id="/d' entities.xml
        sed -i '' '/<Group id="/d' entities.xml
        sed -i '' '/<Membership id="/d' entities.xml
        sed -i '' '/<GroupAttribute id="/d' entities.xml
        
      2. Contact Atlassian Support to manually delete the add-on users

              Unassigned Unassigned
              dbrito Daniel Brito [Atlassian]
              Votes:
              17 Vote for this issue
              Watchers:
              18 Start watching this issue

                Created:
                Updated:
                Resolved: