com.atlassian.confluence.core.InsufficientPrivilegeException: User [sysadmin] does not have the required privileges.

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.confluence.core.InsufficientPrivilegeException: User [sysadmin] does not have the required privileges.
  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.confluence.core.InsufficientPrivilegeException: User [sysadmin] does not have the required privileges.
  3. 0

    Despite that running SnipSnap import as a Confluence administrator, Confluence treats the admin user as anonymous due to a wrong context used. The error encountered is: {noformat} 2010-02-24 15:51:17,736 ERROR [Importing data task] [core.task.longrunning.AbstractLongRunningTask] runInternal Failure during import -- referer: http://localhost:25555/admin/snipsnapimport-start.action | url: /admin/snipsnapimport.action | userName: admin | action: snipsnapimport com.atlassian.confluence.core.InsufficientPrivilegeException: User [Anonymous] does not have the required privileges. at com.atlassian.confluence.user.DefaultUserAccessor.addMembership(DefaultUserAccessor.java:76) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:20) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy28.addMembership(Unknown Source) at com.atlassian.confluence.importexport.impl.snipsnap.SnipSnapImporter.importUser(SnipSnapImporter.java:217) at com.atlassian.confluence.importexport.impl.snipsnap.SnipSnapImporter.importUsers(SnipSnapImporter.java:197) at com.atlassian.confluence.importexport.impl.snipsnap.SnipSnapImporter.importAll(SnipSnapImporter.java:171) at com.atlassian.confluence.importexport.impl.snipsnap.SnipSnapImporter.doImport(SnipSnapImporter.java:112) at com.atlassian.confluence.importexport.DefaultImportExportManager.importAs(DefaultImportExportManager.java:75) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy65.importAs(Unknown Source) at com.atlassian.confluence.importexport.actions.ImportLongRunningTask.runInternal(ImportLongRunningTask.java:45) at com.atlassian.confluence.util.longrunning.ConfluenceAbstractLongRunningTask.run(ConfluenceAbstractLongRunningTask.java:21) at java.lang.Thread.run(Thread.java:595) {noformat}

    Atlassian JIRA | 7 years ago | Roy Hartono [Atlassian]
    com.atlassian.confluence.core.InsufficientPrivilegeException: User [Anonymous] does not have the required privileges.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    {noformat} 2010-02-24 15:51:17,736 ERROR [Importing data task] [core.task.longrunning.AbstractLongRunningTask] runInternal Failure during import -- referer: http://localhost:25555/admin/snipsnapimport-start.action | url: /admin/snipsnapimport.action | userName: admin | action: snipsnapimport com.atlassian.confluence.core.InsufficientPrivilegeException: User [Anonymous] does not have the required privileges. at com.atlassian.confluence.user.DefaultUserAccessor.addMembership(DefaultUserAccessor.java:76) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:20) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy28.addMembership(Unknown Source) at com.atlassian.confluence.importexport.impl.snipsnap.SnipSnapImporter.importUser(SnipSnapImporter.java:217) at com.atlassian.confluence.importexport.impl.snipsnap.SnipSnapImporter.importUsers(SnipSnapImporter.java:197) at com.atlassian.confluence.importexport.impl.snipsnap.SnipSnapImporter.importAll(SnipSnapImporter.java:171) at com.atlassian.confluence.importexport.impl.snipsnap.SnipSnapImporter.doImport(SnipSnapImporter.java:112) at com.atlassian.confluence.importexport.DefaultImportExportManager.importAs(DefaultImportExportManager.java:75) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy65.importAs(Unknown Source) at com.atlassian.confluence.importexport.actions.ImportLongRunningTask.runInternal(ImportLongRunningTask.java:45) at com.atlassian.confluence.util.longrunning.ConfluenceAbstractLongRunningTask.run(ConfluenceAbstractLongRunningTask.java:21) at java.lang.Thread.run(Thread.java:595) {noformat} Current user appears to be not set correctly, causing permission check to fail when an admin is trying to import snipsnap users and groups. The hack solution is to include: AuthenticatedUserThreadLocal.setUser(context.getCurrentUser()); in {{com.atlassian.confluence.importexport.impl.snipsnap.SnipSnapImporter#doImport()}}.

    Atlassian JIRA | 7 years ago | Roy Hartono [Atlassian]
    com.atlassian.confluence.core.InsufficientPrivilegeException: User [Anonymous] does not have the required privileges.

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. com.atlassian.confluence.core.InsufficientPrivilegeException

      User [sysadmin] does not have the required privileges.

      at com.atlassian.confluence.user.DefaultUserAccessor.addMembership()
    2. com.atlassian.confluence
      DefaultUserAccessor.addMembership
      1. com.atlassian.confluence.user.DefaultUserAccessor.addMembership(DefaultUserAccessor.java:165)
      1 frame