Uploaded image for project: 'Confluence Cloud'
  1. Confluence Cloud
  2. CONFCLOUD-54387

Import fails with groups containing leading or trailing whitespace

    XMLWordPrintable

Details

    Description

      The error displayed on screen after failing is:
      Import failed. Check your server logs for more information. User [sysadmin] does not have the required privileges.
      The import fails and rolls back.

      Problem:
      When a entities.xml contains a group name with leading or trailing whitespaces the log first shows this error and keeps going:

      com.atlassian.user.impl.EntityValidationException: com.atlassian.crowd.exception.embedded.InvalidGroupException: com.atlassian.crowd.exception.InvalidGroupException: Group name may not contain leading or trailing whitespace
       	at com.atlassian.crowd.embedded.atlassianuser.EmbeddedCrowdGroupManager.createGroup(EmbeddedCrowdGroupManager.java:144)
       	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      ...
      

      Later when giving users the memberships:

      INFO [Long running task: Importing data] [confluenceimporter.procesors.post.UserPostImportTask] updateGroupMemberships Adding user xxxx to group GroupName with a space at the end 

      a few lines after the last log about memberships we find:

      ERROR [Long running task: Importing data] [confluence.importexport.actions.ImportLongRunningTask] runInternal Failure during import
        -- url: /wiki/admin/import/doimportconfluencesite.action | userName: sysadmin | referer: https://xxxxx.atlassian.net/wiki/admin/import/importconfluencesite.action | action: doimportconfluencesite
      com.atlassian.confluence.core.InsufficientPrivilegeException: User [sysadmin] does not have the required privileges.
       	at com.atlassian.confluence.user.DefaultUserAccessor.addMembership(DefaultUserAccessor.java:165)
      ...
      

      and checking the entities.xml we find that that particular last GroupName has a trailing whitespace. There might be more than one but it will fail with the first one and rolls back.

      Workaround:
      Manually remove the whitespace on every group appearance in entities.xml and import again

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: