"Failed to load data from Bitbucket" error while trying to change branch
Asked by Vasyl B:

I'm trying to change the branch of my build on Bamboo (version 6.7.1 build 60705 - 18 Oct 18) and receiving this error.

The last build ran a week ago and everything was ok.

What could be the reason?

![bamboo-error.png](/t5/image/serverpage/image-id/59022iD300D601FF88D896/image-dimensions/623x252?v=v2 "bamboo-error.png")


Answers:
author: Daniel Santos
body: Hi [@Vasyl B](/t5/user/viewprofilepage/user-id/3410440)

I can see there is a response error from Bitbucket server, but we will need to know which error is this to be able to move forward.  

It is possible that this is related to an application link configuration issue.

My suggestions:

1. Try to recreate the application links (Bamboo - Bitbucket).
2. Check the server logs (*\<Bamboo_Home\>/logs/atlassian-bamboo.log*) to see which errors you see there.
3. Check if there are any KBs related to those errors. If not, share them here so we can investigate it further.

comments: author: Vasyl B
body: Hi [@Daniel Santos](/t5/user/viewprofilepage/user-id/502125) ,

1. I tried to recreate a repository and received another error:

![repo-error.png](https://community.atlassian.com/t5/image/serverpage/image-id/59208iBD58E85A19200893/image-dimensions/891x290?v=v2 "repo-error.png")

2. Logs:

```
2019-07-01 09:56:47,963 INFO [http-nio-8085-exec-10] [AccessLogFilter] admin GET http://build.blabla.com/admin/editLinkedRepository.action?repositoryId=622593&decorator=nothing&confirm=true&_=1561974999130 273286kb
2019-07-01 09:56:48,697 INFO [http-nio-8085-exec-22] [AccessLogFilter] admin POST http://build.blabla.com/rest/hg/latest/bb/repositories/some-repo/branches/ 217960kb
2019-07-01 09:56:48,697 INFO [http-nio-8085-exec-1] [AccessLogFilter] admin POST http://build.blabla.com/rest/hg/latest/bb/repositories/ 217960kb
2019-07-01 09:56:48,729 INFO [http-nio-8085-exec-16] [AccessLogFilter] admin GET http://build.blabla.com/rest/api/latest/permissions/repository/622593/users?limit=30&start=0&name=&_=1561974999131 213430kb
2019-07-01 09:56:48,744 INFO [http-nio-8085-exec-6] [AccessLogFilter] admin GET http://build.blabla.com/rest/api/latest/permissions/repository/622593/groups?limit=30&start=0&name=&_=1561974999132 212948kb
2019-07-01 09:56:48,947 INFO [http-nio-8085-exec-11] [AccessLogFilter] admin GET http://build.blabla.com/rest/api/latest/permissions/repository/622593/roles?limit=30&start=0&name=&_=1561974999133 209054kb
2019-07-01 09:56:48,963 INFO [http-nio-8085-exec-18] [AccessLogFilter] admin GET http://build.blabla.com/rest/api/latest/repository/622593/rssrepository?_=1561974999134 208635kb
2019-07-01 09:56:49,104 WARN [http-nio-8085-exec-22] [RESTCall] Response from GET https://api.bitbucket.org/1.0/repositories/company_name/repo_name/branches-tags/ (410)
2019-07-01 09:56:49,104 WARN [http-nio-8085-exec-22] [BitbucketResource] Failed to load data from Bitbucket. Call to https://api.bitbucket.org/1.0/repositories/company_name/repo_name/branches-tags/ returned 410.
2019-07-01 09:56:49,119 WARN [http-nio-8085-exec-1] [RESTCall] Response from GET https://api.bitbucket.org/1.0/user/repositories/?format=xml (410)
2019-07-01 09:56:49,119 WARN [http-nio-8085-exec-1] [BitbucketResource] Failed to load data from Bitbucket. Call to https://api.bitbucket.org/1.0/user/repositories/?format=xml returned 410.
2019-07-01 09:56:49,197 INFO [http-nio-8085-exec-8] [AccessLogFilter] admin GET http://build.blabla.com/rest/api/latest/repository/622593/scan/status?_=1561974999135 206871kb
```

3. What do you mean on KBs? Windows updates?


author: Daniel Santos
body: Hi [@Vasyl B](/t5/user/viewprofilepage/user-id/3410440)

I'm sorry about the KBs acronym (Knowledge Base Articles).  

There is something curious if I compare the first image with the second one. The first image had mentioned **Bitbucket server** (self-hosted in your company)and the second one is clearly a configuration for **Bitbucket cloud** (hosted by Atlassian). Is your repository using Bitbucket server or cloud?  

If you are using **server** my comment will still apply and you need to make sure you are recreating the repository configuration with a Bitbucket server repository which requires an application link with your Bitbucket server.

If you are using Bitbucket cloud then there is an issue that we need to give some attention which is the recent change in the API caused by the GDPR compliance. It broke the repository configuration handshake for older Bamboo instances requiring a workaround or instance upgrade to move forward.

More information can be found here:

* [Unable to add or edit Bitbucket Cloud repository in Bamboo](https://community.atlassian.com/t5/Bamboo-articles/Unable-to-add-or-edit-Bitbucket-Cloud-repository-in-Bamboo/ba-p/1099927)
* [\[BAM-20455\] Cannot save Bitbucket Cloud Repository: Invalid Username and We couldn't connect to the repository errors](https://jira.atlassian.com/browse/BAM-20455)

In case you are using Bitbucket Cloud, you will probably need to configure the repository using the workaround discussed in the above links which is configuring Bitbucket using the Git repository config in the Bamboo side.


author: Vasyl B
body: Hi [@Daniel Santos](/t5/user/viewprofilepage/user-id/502125) ,

I've upgraded Bamboo to the latest version and now it works fine.

Thanks a lot for your assistance.


author: Daniel Santos
body: You are welcome!  
I'm glad it is working now =\]