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

JIRA Cloud import "Failed to import user remotely" for admin's email address

    XMLWordPrintable

Details

    Description

      Summary

      JIRA Cloud Import fails when there is a user in the backup file that has the same email address but doesn't match case (has a mismatch uppercase or lowercase letter) to the 'site-admin' performing the import and the username is different.

      The following error is shown on screen

      Unexpected error while restoring data: com.atlassian.crowd.exception.runtime.OperationFailedException: Failed to import user remotely

      JIRA locks and requires a restart.

      Example:

      Existing site-admin doing the import:

      • username: admin
      • email address: test@test.com

      User in the backup file:

      • username: Fred
      • email address: Test@test.com

      That is the only scenario when it fails. Identical username or email address will be skipped during the user during import.

      Environment

      • JIRA Cloud

      Steps to Reproduce

      Customers find this problem when migrating from Server to Cloud and using the same email address that was on their server site.

      To force the error do:

      1. Generate a backup file from Cloud
      2. Extract entities.xml from zip
      3. Manually edit the entities.xml file and set the admin user's email address to any other user on the xml but changing a letter to uppercase.
      4. Zip the backup
      5. Login to Cloud using the same admin email address used on step 3
      6. Import in Cloud

      Expected Results

      JIRA import succeeds

      Actual Results

      Error is shown on screen and JIRA is locked.

      JIRA logs:

      Caused by: com.atlassian.idp.client.exceptions.BadRequestException: {"errorType":"UserAlreadyExists","message":"Duplicate email address: Test@test.com","data":"Test@test.com"}
      

      Full log:

      2017-03-06 12:06:17.399977500 2017-03-06 12:06:17,398 JiraImportTaskExecutionThread-1 ERROR admin 722x507x1  119.17.160.226 /secure/admin/StudioImport!import.jspa [c.a.j.studio.importer.StudioImport] Unexpected error while restoring data: com.atlassian.crowd.exception.runtime.OperationFailedException: Failed to import user remotely
      2017-03-06 12:06:17.399979500 com.atlassian.crowd.exception.runtime.OperationFailedException: Failed to import user remotely
      2017-03-06 12:06:17.399980500 	at com.atlassian.crowd.embedded.core.CrowdServiceImpl.importUser(CrowdServiceImpl.java:452)
      2017-03-06 12:06:17.400006500 	at com.atlassian.crowd.embedded.core.DelegatingCrowdService.importUser(DelegatingCrowdService.java:147)
      2017-03-06 12:06:17.400007500 	at com.atlassian.crowd.embedded.core.FilteredCrowdServiceImpl.importUser(FilteredCrowdServiceImpl.java:50)
      2017-03-06 12:06:17.400007500 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2017-03-06 12:06:17.400007500 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      2017-03-06 12:06:17.400012500 	... 1 filtered
      2017-03-06 12:06:17.400012500 	at java.lang.reflect.Method.invoke(Method.java:498)
      2017-03-06 12:06:17.400013500 	at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)
      2017-03-06 12:06:17.400018500 	at com.sun.proxy.$Proxy364.importUser(Unknown Source)
      2017-03-06 12:06:17.400019500 	... 3 filtered
      2017-03-06 12:06:17.400019500 	at java.lang.reflect.Method.invoke(Method.java:498)
      2017-03-06 12:06:17.400019500 	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
      2017-03-06 12:06:17.400020500 	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56)
      2017-03-06 12:06:17.400024500 	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60)
      2017-03-06 12:06:17.400024500 	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      2017-03-06 12:06:17.400025500 	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
      2017-03-06 12:06:17.400028500 	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
      2017-03-06 12:06:17.400029500 	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      2017-03-06 12:06:17.400030500 	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor$1.run(ServiceTCCLInterceptor.java:61)
      2017-03-06 12:06:17.400035500 	at org.eclipse.gemini.blueprint.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:130)
      2017-03-06 12:06:17.400035500 	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokePrivileged(ServiceTCCLInterceptor.java:58)
      2017-03-06 12:06:17.400036500 	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:50)
      2017-03-06 12:06:17.400044500 	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      2017-03-06 12:06:17.400045500 	at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57)
      2017-03-06 12:06:17.400045500 	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      2017-03-06 12:06:17.400049500 	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
      2017-03-06 12:06:17.400050500 	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
      2017-03-06 12:06:17.400050500 	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      2017-03-06 12:06:17.400055500 	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
      2017-03-06 12:06:17.400056500 	at com.sun.proxy.$Proxy14356.importUser(Unknown Source)
      2017-03-06 12:06:17.400056500 	at com.atlassian.studio.jira.importer.impl.user.JiraUserServiceImpl.createNewUser(JiraUserServiceImpl.java:265)
      2017-03-06 12:06:17.400057500 	at com.atlassian.studio.jira.importer.impl.user.JiraUserServiceImpl.lambda$transferUsersToCrowd$4(JiraUserServiceImpl.java:199)
      2017-03-06 12:06:17.400061500 	at com.atlassian.studio.jira.importer.impl.user.JiraUserServiceImpl.forEach(JiraUserServiceImpl.java:318)
      2017-03-06 12:06:17.400061500 	at com.atlassian.studio.jira.importer.impl.user.JiraUserServiceImpl.transferUsersToCrowd(JiraUserServiceImpl.java:184)
      2017-03-06 12:06:17.400062500 	at com.atlassian.studio.jira.importer.impl.user.JiraUserServiceImpl.migrateInternalDirectoryToCrowd(JiraUserServiceImpl.java:116)
      2017-03-06 12:06:17.400066500 	at com.atlassian.studio.jira.importer.impl.StudioImporterFacade.synchroniseUsersToCrowd(StudioImporterFacade.java:177)
      2017-03-06 12:06:17.400066500 	at com.atlassian.jira.studio.importer.StudioDataImportAsyncCommand.doStudioImportTasks(StudioDataImportAsyncCommand.java:319)
      2017-03-06 12:06:17.400071500 	at com.atlassian.jira.studio.importer.StudioDataImportAsyncCommand.importJiraExportData(StudioDataImportAsyncCommand.java:181)
      2017-03-06 12:06:17.400072500 	at com.atlassian.jira.studio.importer.StudioDataImportAsyncCommand.importDataAndFiles(StudioDataImportAsyncCommand.java:165)
      2017-03-06 12:06:17.400072500 	at com.atlassian.jira.studio.importer.StudioDataImportAsyncCommand.call(StudioDataImportAsyncCommand.java:117)
      2017-03-06 12:06:17.400076500 	at com.atlassian.jira.studio.importer.StudioDataImportAsyncCommand.call(StudioDataImportAsyncCommand.java:61)
      2017-03-06 12:06:17.400077500 	at com.atlassian.jira.task.ImportTaskManagerImpl$TaskCallableDecorator.call(ImportTaskManagerImpl.java:158)
      2017-03-06 12:06:17.400077500 	at com.atlassian.jira.task.ImportTaskManagerImpl$TaskCallableDecorator.call(ImportTaskManagerImpl.java:134)
      2017-03-06 12:06:17.400081500 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      2017-03-06 12:06:17.400082500 	at com.atlassian.jira.util.UnicornOnlyWorkContextCreatingExecutorService.lambda$wrapWithWorkContext$8(UnicornOnlyWorkContextCreatingExecutorService.java:218)
      2017-03-06 12:06:17.400082500 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      2017-03-06 12:06:17.400087500 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      2017-03-06 12:06:17.400088500 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      2017-03-06 12:06:17.400088500 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      2017-03-06 12:06:17.400088500 	at java.lang.Thread.run(Thread.java:745)
      2017-03-06 12:06:17.400089500 Caused by: com.atlassian.crowd.exception.OperationFailedException: Failed to import user remotely
      2017-03-06 12:06:17.400093500 	at com.atlassian.crowd.directory.RemoteCrowdDirectory.importUser(RemoteCrowdDirectory.java:416)
      2017-03-06 12:06:17.400093500 	at com.atlassian.crowd.directory.DbCachingRemoteDirectory.importUser(DbCachingRemoteDirectory.java:862)
      2017-03-06 12:06:17.400094500 	at com.atlassian.crowd.manager.directory.DirectoryManagerGeneric.importUser(DirectoryManagerGeneric.java:313)
      2017-03-06 12:06:17.400100500 	at com.atlassian.crowd.manager.application.ApplicationServiceGeneric.importUser(ApplicationServiceGeneric.java:682)
      2017-03-06 12:06:17.400101500 	at com.atlassian.crowd.embedded.core.CrowdServiceImpl.importUser(CrowdServiceImpl.java:443)
      2017-03-06 12:06:17.400101500 Caused by: com.atlassian.idp.client.exceptions.BadRequestException: {"errorType":"UserAlreadyExists","message":"Duplicate email address: Test@test.com","data":"Test@test.com"}
      2017-03-06 12:06:17.400107500 	at com.atlassian.idp.client.IdentityPlatformClientImpl.mapStatusCodeException(IdentityPlatformClientImpl.java:482)
      2017-03-06 12:06:17.400108500 	at com.atlassian.idp.client.IdentityPlatformClientImpl.mapInputStream(IdentityPlatformClientImpl.java:447)
      2017-03-06 12:06:17.400108500 	at com.atlassian.idp.client.IdentityPlatformClientImpl.makeRequestWithEntityBody(IdentityPlatformClientImpl.java:432)
      2017-03-06 12:06:17.400112500 	at com.atlassian.idp.client.IdentityPlatformClientImpl.importUser(IdentityPlatformClientImpl.java:322)
      2017-03-06 12:06:17.400113500 	at com.atlassian.crowd.directory.RemoteCrowdDirectory.importUser(RemoteCrowdDirectory.java:411)
      2017-03-06 12:06:17.404719500 2017-03-06 12:06:17,404 JiraImportTaskExecutionThread-1 INFO admin 722x507x1  119.17.160.226 /secure/admin/StudioImport!import.jspa [c.a.j.studio.importer.StudioImport] Import finished
      

      Notes

      The error shown is very similar to JRA-63788 but on this scenario the XML doesn't contain duplicate email addresses. The email address mention matches the site admin.

      Workaround

      Contact support to restore JIRA functionality and mention the file used to import so Support can run the import in your behalf. This will succeed because it will be done using the sysadmin username instead of the site admin.
      Alternative: modify the email address on the source site to case match the one on the Cloud site and create a new backup.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mfernandezbadii Mauro Badii
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: