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

Atlassian JIRA | Mauro Fernandez Badii [Atlassian] | 3 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    The error displayed on screen after failing is: {color:red}Import failed. Check your server logs for more information. User [sysadmin] does not have the required privileges.{color} 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: {noformat} 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) ... {noformat} Later when giving users the memberships: {noformat}INFO [Long running task: Importing data] [confluenceimporter.procesors.post.UserPostImportTask] updateGroupMemberships Adding user xxxx to group GroupName with a space at the end {noformat} a few lines after the last log about memberships we find: {noformat}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) ... {noformat} 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

    Atlassian JIRA | 3 years ago | Mauro Fernandez Badii [Atlassian]
    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
  2. 0

    The error displayed on screen after failing is: {color:red}Import failed. Check your server logs for more information. User [sysadmin] does not have the required privileges.{color} 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: {noformat} 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) ... {noformat} Later when giving users the memberships: {noformat}INFO [Long running task: Importing data] [confluenceimporter.procesors.post.UserPostImportTask] updateGroupMemberships Adding user xxxx to group GroupName with a space at the end {noformat} a few lines after the last log about memberships we find: {noformat}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) ... {noformat} 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

    Atlassian JIRA | 3 years ago | Mauro Fernandez Badii [Atlassian]
    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

    Root Cause Analysis

    1. 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()
    2. com.atlassian.crowd
      EmbeddedCrowdGroupManager.createGroup
      1. com.atlassian.crowd.embedded.atlassianuser.EmbeddedCrowdGroupManager.createGroup(EmbeddedCrowdGroupManager.java:144)
      1 frame
    3. Java RT
      NativeMethodAccessorImpl.invoke0
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      1 frame