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

Better exception handling when getting 401 or 404 from Bitbucket Cloud rest call

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Fixed
    • 5.14.3.1
    • None
    • None
    • 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

      When Bitbucket returns a 404 or 401 when trying to query for tags and branches, Bamboo logs the whole HTML response in the logs. This can cause the logs to grow in size.

      Steps to reproduce

      1. Create a Bitbucket Cloud linked repository and create a plan to use it
      2. Delete the bitbucket repository in Bitbucket Cloud
      3. Go to Edit Plan >> Branches

      Expected outcome

      Bamboo logs the whole HTML response:

      2016-11-29 11:02:50,180 WARN [http-nio-8085-exec-20] [RESTCall] Response from GET /1.0/repositories/username/reponame/branches-tags/ null (404): <!DOCTYPE html>
      <html lang="en">
      <head>
        <meta id="bb-bootstrap" data-current-user="{&quot;username&quot;: &quot;dericleeyy&quot;, &quot;displayName&quot;: &quot;Deric Lee&quot;, &quot;uuid&quot;: &quot;{ecf95ecb-e91a-40e6-b6f6-b658aca3b60f}&quot;, &quot;firstName&quot;: &quot;Deric Lee&quot;, &quot;avatarUrl&quot;: &quot;https://bitbucket.org/account/dericleeyy/avatar/32/?ts=1480407352&quot;, &quot;lastName&quot;: &quot;&quot;, &quot;isTeam&quot;: false, &quot;isSshEnabled&quot;: true, &quot;isKbdShortcutsEnabled&quot;: true, &quot;id&quot;: 2946122, &quot;isAuthenticated&quot;: true}" />
        
        
      ...
      

      Improvement

      Improve the exception handling for these cases and avoid filling the logs

      Workaround

      Mute some of the RESTCall logs by adding this in Bamboo Install/atlassian-bamboo/WEB-INF/classes/log4j.properties:

      log4j.category.com.atlassian.utils.RESTCall=ERROR
      

      Then, restart Bamboo

      Attachments

        Activity

          People

            kbrazulewicz Krystian Brazulewicz
            dlee@atlassian.com Deric Lee (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: