Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-17466

Bamboo doesn't retry to update build status in Bitbucket Cloud

    XMLWordPrintable

Details

    • 0
    • 7
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      Summary

      The API call Bamboo makes to Bitbucket Cloud after build completion to update the build status may occasionally fail for various reasons. It appears Bamboo makes no attempt to retry or reconcile these calls should they fail. Consequently, build status information in Bitbucket Cloud will be left incorrect or incomplete should these calls fail.

      Steps to Reproduce

      Issue is intermittent in most cases but having two build plans that trigger on the same commit appears to be a reliable way to reproduce the behavior.

      1. Configure Bamboo to use a Bitbucket Cloud repository
      2. Create two build plans that build from that same repository\branch
      3. Configure plan triggers to execute plans on commit
      4. Enable debug logging for the following packages in Bamboo
        com.atlassian.bamboo.plugins.bitbucket.api.BitbucketApiException
        com.atlassian.bamboo.plugins.bitbucket.api.BitbucketApiService
      5. Make a commit in the Bitbucket Cloud repository in order to trigger the build plans


      Expected Results

      Bamboo updates the build status on completion and the correct status for all builds executed is reflected in Bitbucket Cloud.

      Actual Results

      If the post build status update fails, build status is either not present or incomplete in Bitbucket Cloud and will remain as such.

      Logs will contain varying levels of error detail depending on how the call failed. Below message is most common.

      2016-04-19 02:26:20,549 INFO [AtlassianEvent::0-BAM::EVENTS:pool-2-thread-3] [BitbucketBuildStatusUpdater] Unable to sent build status update to Bitb
      ucket
      

      In addition, Bitbucket Cloud may return an HTTP error code response that will cause the call to fail.

      2016-04-19 00:31:42.430491500 com.atlassian.bamboo.plugins.bitbucket.api.BitbucketApiException: com.sun.jersey.api.client.UniformInterfaceException: POST https://api.bitbucket.org/2.0/repositories/rgouldSE/testrepo/commit/a01e4577d962fa7b1904f90b29f122ea7daa7117/statuses/build returned a response status of 503 Service Unavailable
      2016-04-19 00:31:42.430492500 	at com.atlassian.bamboo.plugins.bitbucket.impl.BitbucketApiServiceImpl.updateBuildStatus(BitbucketApiServiceImpl.java:167)
      2016-04-19 00:31:42.430507500 	at com.atlassian.bamboo.plugins.bitbucket.events.BitbucketBuildStatusUpdater.lambda$buildStatusUpdater$2(BitbucketBuildStatusUpdater.java:114)
      2016-04-19 00:31:42.430508500 	at com.atlassian.bamboo.plugins.bitbucket.events.BitbucketBuildStatusUpdater$$Lambda$171/19284880.accept(Unknown Source)
      2016-04-19 00:31:42.430508500 	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
      2016-04-19 00:31:42.430510500 	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
      2016-04-19 00:31:42.430511500 	at java.util.Iterator.forEachRemaining(Iterator.java:116)
      2016-04-19 00:31:42.430514500 	at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
      2016-04-19 00:31:42.430514500 	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:512)
      2016-04-19 00:31:42.430515500 	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502)
      2016-04-19 00:31:42.430515500 	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
      2016-04-19 00:31:42.430521500 	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
      2016-04-19 00:31:42.430522500 	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      2016-04-19 00:31:42.430522500 	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
      2016-04-19 00:31:42.430522500 	at com.atlassian.bamboo.plugins.bitbucket.events.BitbucketBuildStatusUpdater.send(BitbucketBuildStatusUpdater.java:79)
      2016-04-19 00:31:42.430524500 	at com.atlassian.bamboo.build.status.AbstractBuildStatusUpdater.handleEvent(AbstractBuildStatusUpdater.java:60)
      2016-04-19 00:31:42.430525500 	at sun.reflect.GeneratedMethodAccessor3381.invoke(Unknown Source)
      2016-04-19 00:31:42.430525500 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      2016-04-19 00:31:42.430525500 	at java.lang.reflect.Method.invoke(Method.java:497)
      2016-04-19 00:31:42.430528500 	at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:36)
      2016-04-19 00:31:42.430528500 	at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1$1.run(AsynchronousAbleEventDispatcher.java:46)
      2016-04-19 00:31:42.430529500 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      2016-04-19 00:31:42.430529500 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      2016-04-19 00:31:42.430530500 	at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:49)
      2016-04-19 00:31:42.430531500 	at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31)
      2016-04-19 00:31:42.430531500 	at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20)
      2016-04-19 00:31:42.430532500 	at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52)
      2016-04-19 00:31:42.430533500 	at java.lang.Thread.run(Thread.java:745)
      2016-04-19 00:31:42.430533500 Caused by: com.sun.jersey.api.client.UniformInterfaceException: POST https://api.bitbucket.org/2.0/repositories/rgouldSE/testrepo/commit/a01e4577d962fa7b1904f90b29f122ea7daa7117/statuses/build returned a response status of 503 Service Unavailable
      2016-04-19 00:31:42.430537500 	at com.sun.jersey.api.client.WebResource.voidHandle(WebResource.java:697)
      2016-04-19 00:31:42.430537500 	at com.sun.jersey.api.client.WebResource.access$400(WebResource.java:74)
      2016-04-19 00:31:42.430538500 	at com.sun.jersey.api.client.WebResource$Builder.post(WebResource.java:548)
      2016-04-19 00:31:42.430539500 	at com.atlassian.bamboo.plugins.bitbucket.impl.BitbucketApiServiceImpl.updateBuildStatus(BitbucketApiServiceImpl.java:157)
      2016-04-19 00:31:42.430540500 	... 26 more
      

      Workaround

      No known workaround.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rgould@atlassian.com Russ Gould [Atlassian]
              Votes:
              3 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated: