Connection denied if the BitBucket Cloud repo is used, ok with the direct URL
Asked by Christophe L.:

Hi there,

We suddenly have issues connecting to our Git repositories sitting on BitBucket. We get the following message when we test the connection: "*We couldn't connect to the repository. The details you provided were invalid.*". Strangely enough, the drop-down menu does show an up-to-date list of available branches.

We use username/password as credentials, not SSH keys. We've deleted the cache for the repo we were considering in particular, to no avail.

If we add the repo through 'Add repo' / 'Git' (not BitBucket), the connection is fine.

Our plans used to work, we haven't modified them. The only recent change is a Bamboo upgrade (self-hosted) to version 6.9.0.

Any ideas? Thanks in advance


Answers:
author: Ellie Z _they_them_
body: Hi [@Christophe L.](/t5/user/viewprofilepage/user-id/1615093), [@Renato Guimaraes](/t5/user/viewprofilepage/user-id/929404)

Thanks for reaching out to the Atlassian Community!

The issue that you are reporting looks to be related to changes to the Bitbucket Cloud APIs that went live on June 11, 2019. As many of these changes were needed to comply with GDPR, and protect our customer data, the changes went live as quickly as possible. Bamboo versions 6.8.3 and 6.9.1 were released to fix these issues, meaning that you will need to upgrade immediately.

**Some background**

The Bitbucket Cloud REST API v1 was removed, and API v2 endpoints were updated to comply with GDPR privacy regulations. Part of these updates removed a variable containing information that Bamboo expects in the JSON response from Bitbucket.

This change resulted in the creation or editing of Linked repositories of type "Bitbucket Cloud" failing with 401 (Unauthorized) exceptions. You may see "Resource removed" or "Invalid username" error messages in the Bamboo UI as well as the message you mentioned.

For more information on the "Resource removed" issue, please see our public bug report here:

* [BAM-20270: Bitbucket Cloud Repository uses deprecated API 1.0](https://jira.atlassian.com/browse/BAM-20270)

For more information on the GDPR related changes, please see:

* [BAM-20455 - Cannot save Bitbucket cloud repository](https://jira.atlassian.com/browse/BAM-20455)
* [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)

**Workaround**

If you are unable to upgrade right away, as a workaround, we recommend creating Linked repositories of type *[Git](https://confluence.atlassian.com/bamboo/git-289277007.html)* or *[Mercurial](https://confluence.atlassian.com/bamboo/mercurial-289277014.html)* to connect to your [Bitbucket Cloud](https://confluence.atlassian.com/bamboo/bitbucket-cloud-289277000.html) repositories.

I sincerely apologize for any inconvenience this may have caused. Please let us know if you have any questions or concerns.

Thanks,  
Elias \| Bamboo Support

comments: author: Christophe L.
body: thank you Elias, we're updated and it's working now.


author: Renato Guimaraes
body: We are also experiencing this issue.


Tags: atl-bam-20455