Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-18820

Snipsnap importer does not set authenticated user correctly causing user import from snip snap wiki to fail

    XMLWordPrintable

Details

    Description

      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)
      

      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().

      Attachments

        Activity

          People

            Unassigned Unassigned
            rhartono Roy Hartono [Atlassian]
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: