bamboo bitbucket integration
Asked by Valentin Constantinescu:

hi all,

I have serious issues with this basic integration, which should be probably the simplest one and should work by default.

So I am trying to integrated Bamboo 8.0.4 with Bitbucket cloud.

Adding a *Linked Repository* with shared credentials (SSH or username/password) combo do not work. Setting directly the username and password does not work either.

![Screenshot 2022-04-05 at 20.05.53.png](/t5/image/serverpage/image-id/191649i9D56DA36824CC30A/image-size/large?v=v2&px=999 "Screenshot 2022-04-05 at 20.05.53.png")![Screenshot 2022-04-05 at 19.59.09.png](/t5/image/serverpage/image-id/191648i47A093B3856C02BA/image-size/large?v=v2&px=999 "Screenshot 2022-04-05 at 19.59.09.png")

The only thing that works is defining the repo as a generic GIT repo and then all credentials work fine - but there are issues with permissions based branches - these policies are not respected.

I appreciate your suggestions.

Regards


Answers:
author: Eduardo Alvarenga
body: Hello [@Valentin Constantinescu](/t5/user/viewprofilepage/user-id/769571) [@Daniel Saravia](/t5/user/viewprofilepage/user-id/3330588)

Bitbucket Cloud account passwords have been deprecated since March 1st. Please switch to application passwords to restore your checkouts.

More information here:

* [Deprecating Atlassian account password for Bitbucket API and Git activity](https://bitbucket.org/blog/deprecating-atlassian-account-password-for-bitbucket-api-and-git-activity)

Thank you,

Eduardo Alvarenga  
Atlassian Support APAC

comments: author: Valentin Constantinescu
body: Sincerly, I do not understand how this works.

I create an "app password" in the bitbucket user account that I want to use with full permissions for repos.

![Screenshot 2022-04-06 at 14.33.06.png](https://community.atlassian.com/t5/image/serverpage/image-id/191742i97F02B3FE14DD0F4/image-size/large?v=v2&px=999 "Screenshot 2022-04-06 at 14.33.06.png")

I add it to the Bamboo "shared credentials". It does not work to add a new BitBucket cloud repo.

![Screenshot 2022-04-06 at 14.31.51.png](https://community.atlassian.com/t5/image/serverpage/image-id/191744i8AF798484DB6ED68/image-size/large?v=v2&px=999 "Screenshot 2022-04-06 at 14.31.51.png")

I try the username/newly created password directly - the same - it detects not the repos.

![Screenshot 2022-04-06 at 14.31.33.png](https://community.atlassian.com/t5/image/serverpage/image-id/191743i122C6C2FA816B1FC/image-size/large?v=v2&px=999 "Screenshot 2022-04-06 at 14.31.33.png")


author: Eduardo Alvarenga
body: [@Valentin Constantinescu](/t5/user/viewprofilepage/user-id/769571)

You are on the right way. You need to use your Bitbucket.org username and not your email address as the username.

The app password needs to have the following minimal permissions:

* Repositories (read)
* Account (read)

And optionally:

* Pull requests
* Webhooks


author: Valentin Constantinescu
body: it worked. Thanks for the support.


author: Daniel Saravia
body: I'm still not able to connect to bitbucket.

#1 I have created an *App Password*

#2 I'm using a shared credential with the *password* auto-generated in step 1

#3 I'm also using my *Username* as in *bitbucket profile settings*page

but I'm still getting the same warning message when trying to add a repository and test the connection: ***We couldn't connect to the repository. The details you provided were invalid.***

#4 this is the log in atlassian-bamboo.log:

2022-04-06 09:59:26,349 WARN \[http-nio-8085-exec-16\] \[XsrfResourceFilter\] Additional XSRF checks failed for request: <http://localhost:8085/rest/analytics/1.0/publish/bulk> , origin: <https://mytestingserver.pro> , referrer: <https://mytestingserver.pro/chain/admin/config/editChainRepository.action> , credentials in request: true , allowed via CORS: false

and atlassian-bamboo-access.log:

2022-04-06 10:10:44,574 INFO \[http-nio-8085-exec-20\] \[AccessLogFilter\] daniel.saravia PUT <http://localhost:8085/rest/api/latest/repository/testConnection> 413096kb  
2022-04-06 10:10:45,257 INFO \[http-nio-8085-exec-23\] \[AccessLogFilter\] daniel.saravia POST <http://localhost:8085/rest/analytics/1.0/publish/bulk> 411336kb

Please any help is appreciated.


author: Daniel Saravia
body: I tested it on my local environment and it worked, so I did a new research and finally found the solution here <https://jira.atlassian.com/browse/BAM-18063>

In summary,

#1 I had to create an App Password as explained by [@Eduardo Alvarenga](/t5/user/viewprofilepage/user-id/4365410)

#2 Added the configuration to my Tomcat as explained in the above link

#3 Tested again: *Connection successful*


author: Eduardo Alvarenga
body: Thanks [@Daniel Saravia](/t5/user/viewprofilepage/user-id/3330588), if you liked the solution please vote on it so other Community members will be likely to find it quickly.


author: Daniel Saravia
body: I have exactly the same issue, it started around 3 weeks ago. I have even re-installed **Bamboo** on testing server but got the same result: "*We couldn't connect to the repository. The details you provided were invalid."* And "*Failed to load data from Bitbucket. 401 Unauthorized."*

But if I use the same credentials directly in Bitbucket cloud, the login is successful.


Tags: bitbucket