Details
-
Bug
-
Resolution: Fixed
-
Low
-
5.14.0.2
-
Severity 3 - Minor
-
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
- Pick two bitbucket cloud accounts (A and B)
- Login with A and share a repository with B
- Setup a Bamboo instance
- Create a linked repository using the B account and the shared repository
- Configure Bamboo to use a shorter Branch detection interval(Cog icon >> Overview >> General configuration >> Branch Detection Interval), e.g. setting it to 10s
- Create a plan pointing to the linked repository created
- Logging with A on bitbucket cloud and remove the permissions for the B account
- 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", "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>