Migration failed on User import if externalId property is missing from any user

XMLWordPrintable

    • 1
    • Minor

      Issue Summary

      When trying a migration into Cloud, the import fails at user migration phase if there's any user without the externalId property

      Steps to Reproduce

      Make sure one or more users have a null externalId property.

      1. Go to the source instance and null the external_id column of the cwd_user table for one user
      2. Alternatively, remove the property from the XML entities.xml file 
      3. Import into Cloud

      Invalid Example

       <User id="16009" directoryId="1" userName="user A" lowerUserName="user a" active="0" createdDate="2014-05-22 21:29:11.0" updatedDate="2014-05-22 21:29:11.0" firstName="User" lowerFirstName="user" lastName="A" lowerLastName="a" displayName="usera" lowerDisplayName="usera" emailAddress="usera@email.com" lowerEmailAddress="usera@email.com" credential="nopass"/>

      Valid Example

       <User id="16009" directoryId="1" userName="user A" lowerUserName="user a" active="0" createdDate="2014-05-22 21:29:11.0" updatedDate="2014-05-22 21:29:11.0" firstName="User" lowerFirstName="user" lastName="A" lowerLastName="a" displayName="usera" lowerDisplayName="usera" emailAddress="usera@email.com" lowerEmailAddress="usera@email.com" credential="nopass" externalId="a5f77b4b04001c4a918f22b65aba6f30"/>

      Expected Results

      The ExternalIDs will be handled properly if it's missing or null

      Actual Results

      Fails with the following error in the UI

      • Error importing data: cloud.atlassian.logmon.laas.api.PrivacySafeException: Privacy-safe boxing of a com.atlassian.crowd.exception.runtime.OperationFailedException
      java.lang.NullPointerException: accountId
      	at java.util.Objects.requireNonNull(Objects.java:290)
      	at org.apache.commons.lang3.Validate.notBlank(Validate.java:440)
      	at com.atlassian.jira.user.AccountId.<init>(AccountId.java:37)	
      

      Workaround

      Add a dummy externalId property for each affected user that is unique for each user

      To find broken users:

       grep "<User id=" ./entities.xml | grep -v "externalId="

      You can either update these users to include a proper externalId (dummy value) via the entities.xml or add a dummy value in the source instance:

       

      select * from cwd_user where directory_id = 1 and (external_id is null or external_id = '')

              Assignee:
              Unassigned
              Reporter:
              Andy J.
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: