com.atlassian.bitbucket.pull.IllegalPullRequestStateException: This pull request has already been merged.

Atlassian JIRA | Kalpana | 6 months ago
  1. 0

    We are using workzone plugin for codereviews anad automerge. While auto merge, the page is getting refreshed which somehow triggers the Pull request merge(again via api) "Pull Request has already been merged" error pops up in the UI. Pasted the stack trace, from the error it looks like its not Workzone plugin issue. Can you please look into this. 2016-06-15 16:56:52,453 DEBUG [pool-5-thread-1] c.a.bitbucket.scm.BaseCommand Executed /etrade/sit-git-app-bitbucket/packages/git/bin/git log 971070bb916a3462beeaa72ec11a1b6ac68ee47f..2872275be5817d4c00e2873184627b41d94e01c3 --pretty=format:%H --shortstat --no-merges 2016-06-15 16:56:52,453 WARN [pool-5-thread-1] c.s.b.g.idx.commits.ao.AoGraphsDao ((Diffs)) -> 14 2016-06-15 16:56:52,457 WARN [pool-5-thread-1] c.s.b.g.idx.commits.ao.AoGraphsDao --> 4: 2016-06-15 16:56:52,548 DEBUG [http-bio-8443-exec-13] kraju1 @1VGAGP4x1016x1813x0 ghwyr0 10.21.81.213 "GET /rest/api/latest/projects/GIT/repos/gitflowfork/pull-requests/18/merge HTTP/1.1" c.a.s.i.r.e.ServiceExceptionMapper Mapping ServiceException to REST response 409 com.atlassian.bitbucket.pull.IllegalPullRequestStateException: This pull request has already been merged. at com.atlassian.stash.internal.pull.DefaultPullRequestService.checkIsOpen(DefaultPullRequestService.java:1050) ~[bitbucket-service-impl-4.5.1.jar:na] at com.atlassian.stash.internal.pull.DefaultPullRequestService.canMerge(DefaultPullRequestService.java:267) ~[bitbucket-service-impl-4.5.1.jar:na] at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26) ~[atlassian-plugins-core-4.1.1.jar:na] at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56) ~[na:na] at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60) ~[na:na] at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70) ~[na:na] at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53) ~[na:na] at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57) ~[na:na] at com.atlassian.stash.internal.rest.pull.PullRequestResource.canMerge(PullRequestResource.java:427) ~[bitbucket-rest-4.5.1.jar:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26) [applinks-plugin-5.0.5_1459832966000.jar:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26) [applinks-plugin-5.0.5_1459832966000.jar:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26) [applinks-plugin-5.0.5_1459832966000.jar:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26) [applinks-plugin-5.0.5_1459832966000.jar:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26) [applinks-plugin-5.0.5_1459832966000.jar:na] at com.atlassian.plugin.connect.plugin.auth.scope.ApiScopingFilter.doFilter(ApiScopingFilter.java:89) [atlassian-connect-plugin-1.1.70-bitbucket-01.jar:na] at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:88) [classes/:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain(BeforeLoginPluginAuthenticationFilter.java:109) [classes/:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:75) [classes/:na] at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:94) [atlassian-trusted-apps-core-4.2.0.jar:na] at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:67) [atlassian-oauth-service-provider-plugin-2.0.3_1459800554000.jar:na] at com.atlassian.core.filters.ServletContextThreadLocalFilter.doFilter(ServletContextThreadLocalFilter.java:21) [atlassian-core-4.6.19.jar:na] at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31) [atlassian-core-4.6.19.jar:na] at com.atlassian.plugin.connect.plugin.auth.user.ThreeLeggedAuthFilter.doFilter(ThreeLeggedAuthFilter.java:122) [atlassian-connect-plugin-1.1.70-bitbucket-01.jar:na] at com.atlassian.plugin.connect.plugin.auth.oauth.OAuth2LOFilter.doFilter(OAuth2LOFilter.java:82) [atlassian-connect-plugin-1.1.70-bitbucket-01.jar:na] at com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:32) [jwt-plugin-1.5.5_1459832966000.jar:na] at com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:38) [analytics-client-5.2.1_1459832966000.jar:na] at com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:39) [analytics-client-5.2.1_1459832966000.jar:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doBeforeBeforeLoginFilters(BeforeLoginPluginAuthenticationFilter.java:87) [classes/:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:73) [classes/:na] at com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:86) [bitbucket-service-impl-4.5.1.jar:na] at com.atlassian.stash.internal.hazelcast.ConfigurableWebFilter.doFilter(ConfigurableWebFilter.java:38) [classes/:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_40] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_40] ... 279 frames trimmed 2016-06-15 16:56:52,667 DEBUG [http-bio-8443-exec-13] kraju1 @1VGAGP4x1016x1821x2 ghwyr0 10.21.81.213 "GET /rest/jira/latest/projects/GIT/repos/gitflowfork/pull-requests/18/issues HTTP/1.1" c.a.b.i.i.j.DefaultJiraIssueService Bitbucket has not been linked to JIRA 2016-06-15 16:56:52,699 DEBUG [http-bio-8443-exec-19] kraju1 @1VGAGP4x1016x1823x1 ghwyr0 10.21.81.213 "GET /rest/api/latest/inbox/pull-requests/count HTTP/1.1" c.a.s.i.rest.inbox.InboxResource Retrieving pull request count for user

    Atlassian JIRA | 6 months ago | Kalpana
    com.atlassian.bitbucket.pull.IllegalPullRequestStateException: This pull request has already been merged.

    Root Cause Analysis

    1. com.atlassian.bitbucket.pull.IllegalPullRequestStateException

      This pull request has already been merged.

      at com.atlassian.stash.internal.pull.DefaultPullRequestService.checkIsOpen()
    2. com.atlassian.stash
      DefaultPullRequestService.canMerge
      1. com.atlassian.stash.internal.pull.DefaultPullRequestService.checkIsOpen(DefaultPullRequestService.java:1050)[bitbucket-service-impl-4.5.1.jar:na]
      2. com.atlassian.stash.internal.pull.DefaultPullRequestService.canMerge(DefaultPullRequestService.java:267)[bitbucket-service-impl-4.5.1.jar:na]
      2 frames
    3. com.atlassian.plugin
      ContextClassLoaderSettingInvocationHandler.invoke
      1. com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)[atlassian-plugins-core-4.1.1.jar:na]
      1 frame
    4. org.eclipse.gemini
      LocalBundleContextAdvice.invoke
      1. org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56)[na:na]
      2. org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60)[na:na]
      3. org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70)[na:na]
      4. org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53)[na:na]
      5. org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57)[na:na]
      5 frames
    5. com.atlassian.stash
      PullRequestResource.canMerge
      1. com.atlassian.stash.internal.rest.pull.PullRequestResource.canMerge(PullRequestResource.java:427)[bitbucket-rest-4.5.1.jar:na]
      1 frame
    6. com.atlassian.applinks
      ContextFilter.doFilter
      1. com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26)[applinks-plugin-5.0.5_1459832966000.jar:na]
      2. com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26)[applinks-plugin-5.0.5_1459832966000.jar:na]
      3. com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26)[applinks-plugin-5.0.5_1459832966000.jar:na]
      4. com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26)[applinks-plugin-5.0.5_1459832966000.jar:na]
      5. com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26)[applinks-plugin-5.0.5_1459832966000.jar:na]
      5 frames
    7. com.atlassian.plugin
      ApiScopingFilter.doFilter
      1. com.atlassian.plugin.connect.plugin.auth.scope.ApiScopingFilter.doFilter(ApiScopingFilter.java:89)[atlassian-connect-plugin-1.1.70-bitbucket-01.jar:na]
      1 frame
    8. com.atlassian.stash
      BeforeLoginPluginAuthenticationFilter.doFilter
      1. com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:88)[classes/:na]
      2. com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain(BeforeLoginPluginAuthenticationFilter.java:109)[classes/:na]
      3. com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:75)[classes/:na]
      3 frames
    9. com.atlassian.security
      TrustedApplicationsFilter.doFilter
      1. com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:94)[atlassian-trusted-apps-core-4.2.0.jar:na]
      1 frame
    10. com.atlassian.oauth
      OAuthFilter.doFilter
      1. com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:67)[atlassian-oauth-service-provider-plugin-2.0.3_1459800554000.jar:na]
      1 frame
    11. com.atlassian.core
      AbstractHttpFilter.doFilter
      1. com.atlassian.core.filters.ServletContextThreadLocalFilter.doFilter(ServletContextThreadLocalFilter.java:21)[atlassian-core-4.6.19.jar:na]
      2. com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)[atlassian-core-4.6.19.jar:na]
      2 frames
    12. com.atlassian.plugin
      OAuth2LOFilter.doFilter
      1. com.atlassian.plugin.connect.plugin.auth.user.ThreeLeggedAuthFilter.doFilter(ThreeLeggedAuthFilter.java:122)[atlassian-connect-plugin-1.1.70-bitbucket-01.jar:na]
      2. com.atlassian.plugin.connect.plugin.auth.oauth.OAuth2LOFilter.doFilter(OAuth2LOFilter.java:82)[atlassian-connect-plugin-1.1.70-bitbucket-01.jar:na]
      2 frames
    13. com.atlassian.jwt
      JwtAuthFilter.doFilter
      1. com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:32)[jwt-plugin-1.5.5_1459832966000.jar:na]
      1 frame
    14. com.atlassian.analytics
      AbstractHttpFilter.doFilter
      1. com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:38)[analytics-client-5.2.1_1459832966000.jar:na]
      2. com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:39)[analytics-client-5.2.1_1459832966000.jar:na]
      2 frames
    15. com.atlassian.stash
      ConfigurableWebFilter.doFilter
      1. com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doBeforeBeforeLoginFilters(BeforeLoginPluginAuthenticationFilter.java:87)[classes/:na]
      2. com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:73)[classes/:na]
      3. com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:86)[bitbucket-service-impl-4.5.1.jar:na]
      4. com.atlassian.stash.internal.hazelcast.ConfigurableWebFilter.doFilter(ConfigurableWebFilter.java:38)[classes/:na]
      4 frames
    16. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[na:1.8.0_40]
      2. java.lang.Thread.run(Thread.java:745)[na:1.8.0_40]
      2 frames