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

Branch detection errors should not throw full HTML page in Bamboo logs

    XMLWordPrintable

Details

    Description

      Problem

      Bamboo is throwing the whole error page from bitbucket when branch detection is failing with 403 error. This causes the logs to be fast fulfilled with HTML error pages.

      Steps to reproduce

      1. Pick two bitbucket cloud accounts (A and B)
      2. Login with A and share a repository with B
      3. Setup a Bamboo instance
      4. Create a linked repository using the B account and the shared repository
      5. Configure Bamboo to use a shorter Branch detection interval(Cog icon >> Overview >> General configuration >> Branch Detection Interval), e.g. setting it to 10s
      6. Create a plan pointing to the linked repository created
      7. Logging with A on bitbucket cloud and remove the permissions for the B account
      8. Enabled the Branch detection for this plan (plan >> Actions >> Configure plan >> plan configuration >> Automatic branch management >> New branches), by setting it to Create plan branches for all new branches and saving it

      Expected results

      Bamboo logs only show the main description for the error

      Actual results

      The following is thrown in the logs (including the full HTML page returned from Bitbucket cloud):

      2017-02-14 15:49:33,431 WARN [11-BranchDetectionBackgroundThread:pool-19-thread-1] [RESTCall] Response from GET https://api.bitbucket.org/1.0/repositories/danielpsrj/javahello/branches-tags/ (403)
      2017-02-14 15:49:33,507 INFO [11-BranchDetectionBackgroundThread:pool-19-thread-1] [RetryingTaskExecutor] Task 'Detecting branches java hello' was unsuccessful. Run 2 / 2. Exception thrown when running task 'Detecting branches java hello', with message: com.atlassian.bamboo.plugins.bitbucket.api.BitbucketApiException: <!DOCTYPE html>
      <html lang="en">
      <head>
      <meta id="bb-bootstrap" data-current-user="\{"username": "libertum", "displayName": "Daniel P Santos", "uuid": "\{3eee3a0c-a4ea-493b-80c5-c8fbf505eb36}", "firstName": "Daniel P Santos", "avatarUrl": "https://bitbucket.org/account/libertum/avatar/32/?ts=1487105245&quot;, "lastName": "", "isTeam": false, "isSshEnabled": false, "isKbdShortcutsEnabled": true, "id": 8459548, "isAuthenticated": true}" />
      ...
      ...
      ...
      <script type="text/javascript">window.NREUM||(NREUM=\{});NREUM.info=\{"beacon":"bam.nr-data.net","queueTime":0,"licenseKey":"a2cef8c3d3","agent":"","transactionName":"Z11RZxdWW0cEVkYLDV4XdUYLVEFdClsdAAtEWkZQDlJBGgRFQhFMQl1DXFcZVEQMG0RTUh5QUl0BW1BGFg9gBxJfS1pHCkVMdhdUXAEKVUtnUgJEZ1EWWkcQAVU=","applicationID":"6976404","errorBeacon":"bam.nr-data.net","applicationTime":64}</script>
      </body>
      </html>
      

      Attachments

        Activity

          People

            aslaski Adam Slaski
            dsantos Daniel Santos
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: