Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-4935

Merging Pull Request Merges the code and also returns 409

    XMLWordPrintable

Details

    Description

      When using Stash v3.0.4 there is an issue when merging a pull request. When a new pull request is created and merged it merges the code successfully but returns a 409 stating that the pull request has already been merged. Its almost like its submitting a double post. But issuing a git fetch & pull or browsing the code inside of Stash shows that it was successfully merged.

      When running with the Chome debugger we get a response of invalid JSON

      I have been able to replicate this in Chrome, Firefox, Chromium, IE 10

      {All Latest Versions}
      GET https://stash.example.com/rest/api/latest/projects/STAS/repos/stash-test/pull-requests/11/merge 409 (Conflict) batch.js:169
      send batch.js:169
      c.extend.ajax batch.js:163
      P batch.js:1859
      C batch.js:1859
      A batch.js:1861
      N batch.js:3717
      h batch.js:3717
      d.onReady batch.js:3717
      (anonymous function) overview:31
      JQMIGRATE: jQuery.parseJSON requires a valid JSON string 
      
      ==> atlassian-stash.log <==
      2014-07-02 10:04:13,170 DEBUG [http-bio-127.0.0.1-7990-exec-222] matt.trisoline 604x47765x0 5n0dne X.X.X.X,127.0.0.1 "GET /rest/api/latest/projects/STAS/repos/stash-test/pull-requests/10/merge HTTP/1.1" c.a.s.r.e.ServiceExceptionMapper Mapping ServiceException to REST response 409
      com.atlassian.stash.pull.IllegalPullRequestStateException: This pull request has already been merged.
        at com.atlassian.stash.internal.pull.PullRequestServiceImpl.checkIsOpen(PullRequestServiceImpl.java:1010) ~[stash-service-impl-3.0.4.jar:na]
        at com.atlassian.stash.internal.pull.PullRequestServiceImpl.canMerge(PullRequestServiceImpl.java:972) ~[stash-service-impl-3.0.4.jar:na]
        at com.atlassian.stash.internal.pull.PullRequestServiceImpl.canMerge(PullRequestServiceImpl.java:284) ~[stash-service-impl-3.0.4.jar:na]
        at com.atlassian.stash.internal.rest.pull.PullRequestResource.canMerge(PullRequestResource.java:376) ~[stash-rest-3.0.4.jar:na]
        at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:25) [applinks-plugin-4.1.3_1397479846000.jar:na]
        at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:93) [StashAuthenticationFilter.class:na]
        at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain(BeforeLoginPluginAuthenticationFilter.java:111) [BeforeLoginPluginAuthenticationFilter.class:na]
        at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:77) [BeforeLoginPluginAuthenticationFilter.class:na]
        at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:100) [atlassian-trusted-apps-core-3.0.5.jar:na]
        at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:69) [atlassian-oauth-service-provider-plugin-1.9.2_1396905272000.jar:na]
        at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doBeforeBeforeLoginFilters(BeforeLoginPluginAuthenticationFilter.java:89) [BeforeLoginPluginAuthenticationFilter.class:na]
        at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:75) [BeforeLoginPluginAuthenticationFilter.class:na]
        at com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:70) [stash-service-impl-3.0.4.jar:na]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.7.0_05]
        at java.lang.Thread.run(Unknown Source) [na:1.7.0_05]
        ... 230 frames trimmed
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dce6fb423c86 Matthew Trisoline
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: