Uploaded image for project: 'SR for Bitbucket - Development'
  1. SR for Bitbucket - Development
  2. SRBITB-181

Auto add approvers listener fails to add reviewers when pull request updated on laster versions of Bitbucket

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 4.3.10
    • Fix Version/s: 4.3.15
    • Labels:
      None
    • Sprint:
      Sprint 27 - Ends Nov 18
    • Critical Points:
      0

      Description

      On a PullRequestRescopedEvent the auto add approvers fails to add reviewers due to a permissions check against the current user in the authentication context which is empty.

      This results in the following stacktrace:

      2016-11-22 15:12:21 [AtlassianEvent::thread-3] ERROR c.o.s.bitbucket.InnerListener - *************************************************************************************
      2016-11-22 15:12:21 [AtlassianEvent::thread-3] ERROR c.o.s.bitbucket.InnerListener - Event handler failed: event: com.atlassian.bitbucket.event.pull.PullRequestRescopedEvent file: null
      com.atlassian.bitbucket.AuthorisationException: You are not permitted to access this resource
      	at com.atlassian.stash.internal.aop.ExceptionRewriteAdvice.afterThrowing(ExceptionRewriteAdvice.java:36) ~[bitbucket-platform-4.11.1.jar:na]
      	at org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor.invokeHandlerMethod(ThrowsAdviceInterceptor.java:145) ~[spring-aop-4.3.2.RELEASE.jar:4.3.2.RELEASE]
      	at org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor.invoke(ThrowsAdviceInterceptor.java:130) ~[spring-aop-4.3.2.RELEASE.jar:4.3.2.RELEASE]
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168) ~[spring-aop-4.3.2.RELEASE.jar:4.3.2.RELEASE]
      	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) ~[spring-aop-4.3.2.RELEASE.jar:4.3.2.RELEASE]
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.2.RELEASE.jar:4.3.2.RELEASE]
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) ~[spring-aop-4.3.2.RELEASE.jar:4.3.2.RELEASE]
      	at com.sun.proxy.$Proxy225.assignRole(Unknown Source) ~[na:na]
      	at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26) ~[atlassian-plugins-core-4.2.4.jar:na]
      	at com.sun.proxy.$Proxy370.assignRole(Unknown Source) ~[na:na]
      	at com.atlassian.bitbucket.pull.PullRequestService$assignRole.call(Unknown Source) ~[na:na]
      	at com.onresolve.scriptrunner.canned.bitbucket.events.AutoAddApprovers$_doScript_closure2.doCall(AutoAddApprovers.groovy:131) ~[na:na]
      	at com.onresolve.scriptrunner.canned.bitbucket.events.AutoAddApprovers.doScript(AutoAddApprovers.groovy:129) ~[na:na]
      Caused by: org.springframework.security.access.AccessDeniedException: Access is denied
      	at org.springframework.security.access.vote.AffirmativeBased.decide(AffirmativeBased.java:84) ~[spring-security-core-4.1.3.RELEASE.jar:4.1.3.RELEASE]
      	at org.springframework.security.access.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:233) ~[spring-security-core-4.1.3.RELEASE.jar:4.1.3.RELEASE]
      	at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:65) ~[spring-security-core-4.1.3.RELEASE.jar:4.1.3.RELEASE]
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.2.RELEASE.jar:4.3.2.RELEASE]
      	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) ~[spring-tx-4.3.2.RELEASE.jar:4.3.2.RELEASE]
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:280) ~[spring-tx-4.3.2.RELEASE.jar:4.3.2.RELEASE]
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) ~[spring-tx-4.3.2.RELEASE.jar:4.3.2.RELEASE]
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.2.RELEASE.jar:4.3.2.RELEASE]
      	at org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor.invoke(ThrowsAdviceInterceptor.java:125) ~[spring-aop-4.3.2.RELEASE.jar:4.3.2.RELEASE]
      	... 10 common frames omitted
      

        Attachments

          Activity

            People

            Assignee:
            amarkham Adam Markham
            Reporter:
            amarkham Adam Markham
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: