Invalid username when adding a Repository in Bamboo
Asked by Sean Peters:

Hi, I'm trying to modify or add a new repository to our bamboo plan. This has worked for us for a very long time. Today when I try to do it, it comes back with "Invalid username" when I try to save the repository.

I believe this same user name is used to retrieve the list of branches in the repo on the same screen. This works well and even displays the newly created branches.

But when I click "Save Repository" I get an "Invalid username." error. Due to this error I can't add or modify our plan's repo so this is a major issue. I have admin access to the repo and my account is also fine (I can log in fine, I am not locked out).

Can you please let me know how I can add/modify repos? Is this a temporary downtime issue on Bitbucket?

Please note that using Linked Repos as suggested here <https://community.atlassian.com/t5/Bamboo-questions/issue-with-adding-cloud-bitbucket-repository-to-build-plan-on/qaq-p/1097341>, also fails.

Regards,

<br />

Sean


Answers:
author: Sean Peters
body: Hi, updating Git for windows fixed this issue.

comments: author: Victor Debone
body: Hello [@Sean Peters](/t5/user/viewprofilepage/user-id/1096180)

We are still doing efforts on this issue and I wanted to double check your resolution, while making sure that other people that came across this post will not be mislead:

* You have tried to use Linked Repositories with Git (not using the Bitbucket Cloud option)
* It didn't work due an old version of git
* You've updated your Git
* Another attempt of using the Linked repository with Git (again, not with the Bitbucket Cloud option)
* It worked!

If instead, you were still trying to use Bitbucket Cloud and now it is working, it is due a temporary change that is up on Bitbucket Cloud that temporary fixes Bamboo issues, but will be rolled back in the next days :)


author: Colin Cuthbert
body: Hi Victor, we are experiencing the same issue as Sean. For about a week now we have not been able to create or modify repos in Bamboo due to this issue. We do use Bitbucket Cloud.

Loading the repositories list works, but on Save or Test Connection we get "Invalid username" and "We couldn't connect to the repository. The details you provided were invalid."

What is the status of the temporary change? Will there be a permanent fix? We are running Bamboo 6.7.1.


author: Victor Debone
body: Hello [@Colin Cuthbert](/t5/user/viewprofilepage/user-id/1919654)

This issue with Bitbucket Cloud is fixed now on the versions 6.8.3 and 6.9.1. The Bitbucket Cloud rolled back the changes and if you are on older versions of Bamboo, you will not be able to use the repository type "Bitbucket Cloud". You can find more details in [BAM-20455.](https://jira.atlassian.com/browse/BAM-20455)


author: Colin Cuthbert
body: Thanks Victor.


author: seanchaynes
body: And appears to be broken in 6.10. Any ideas?


author: Vitor Pelizza
body: I'm using 6.9.2 and have the same issue.


author: nhhphuong1979
body: I'm using 7.0.3 and I have the same issue


author: Nick Ayala
body: Hey,

I just updated my Git to the latest **git git-update-for-windows**

I have also updated my Bamboo instance from 6.9.1 to 7.0.4

I am still getting this same issue. As everyone is stating, all of my existing repo connection works and I can create plan branches and stuff. But whenever I try to create link a new repo for a specific plan or create a global linked repo, it continues to say my username is invalid.

In my logs I see I am getting back a 404

2020-05-21 11:37:36,750 WARN \[http-nio-8085-exec-3\] \[RESTCall\] Response from GET <https://api.bitbucket.org/2.0/workspaces/nick.ayala@martinmarietta.com/> (404)  
2020-05-21 11:37:36,969 WARN \[http-nio-8085-exec-3\] \[RESTCall\] Response from GET <https://api.bitbucket.org/2.0/users/nick.ayala@martinmarietta.com/> (404)  
2020-05-21 11:37:37,157 WARN \[http-nio-8085-exec-3\] \[RESTCall\] Response from GET <https://api.bitbucket.org/2.0/teams/nick.ayala@martinmarietta.com/> (404)

I even modified the permissions to the temp folder which I saw worked for someone. This is MAJOR because essentially I will not be able to create a new build for a new repo or project.


author: Colin Cuthbert
body: We've started selecting git repo. Not bitbucket. You have to enter url and branch manually, but it works.


author: Nick Ayala
body: Hey,

So after posting my comment I found this workaround / fix for versions 6.8+ and it now works to select Bitbucket Cloud.

[BAM-20900](https://jira.atlassian.com/browse/BAM-20900)

I am running windows and using version 7.0.4 and I added

```
-Dbamboo.bitbucket.cloud.use.workspace.api=true
```

to my system properties (java options)

For version 6.8 and 6.9 you will need to do something else. Just follow the issue I linked and it will explain everything for you.

I hope this helps everyone!