Bug Fix: Sourcetree for Windows authentication error when updating to app password

155 comments

Alastair McQueen
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 23, 2022

Can confirm that simply download and update to windows credential manager 1.19 fixed similar issue for me https://github.com/microsoft/Git-Credential-Manager-for-Windows/releases/tag/1.19.0

Like David Dansby likes this
dammons
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 23, 2022

thanks, but just migrated to github desktop, and it works fine- so think i will stay with it.

Muhammad Asif
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 5, 2022

if anything won't work just try this. 
1. uninstall sourcetree
2. remove all folders under this path: C:\Users\[Your User Name]\AppData\Local\Atlassian
3. Go To Control Panel\User Accounts\Manage Your credentials 
4. Under Windows Credentials tab, delete all saved records related to sourctree or bitbucket or git.

its worked for me. i was fighting with sourcetree 5days.

Dinuka Nipunajith
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 11, 2022

This may help,

Change the URL into this pattern.

https://<USERNAME>:<APP_PASSWORD>@Bitbucket.org/<WORKPACE>/<REPOSITORY>.git

Like # people like this
MCanıtez
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 23, 2022

I'm sorry but this is ridiculous. The service is yours and yours in the app and you don't say an easy way.

Yara Flotin Campos
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 2, 2022

I have tried all solutions and reinstalled several times, but none of it worked. Quite frustrating, I need it for my work.

Yara Flotin Campos
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 2, 2022

I solved it with the solution from the comment:

"

This may help,

Change the URL into this pattern.

https://<USERNAME>:<APP_PASSWORD>@Bitbucket.org/<WORKPACE>/<REPOSITORY>.git

"

시바휘바ShibaHyvaa
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 7, 2022

now it's not working~ i am a newbie

Like SmallDe likes this
Rob Farthing
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 21, 2022

@Daniel_Schulze Your comment was the only thing that fixed this dreadful issue for me. Truly awful app behaviour on Sourcetree's part for not handling this itself or clearing it on uninstall at least!

Like SmallDe likes this
Rafael Lopes Vivian
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 26, 2022

I never had Sourcetree installed, never needed it in the first place. Just another bloat to install on each and every machine.

kangjianwei
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 3, 2022

After I upgraded to 4.2, the UI layout was messed up! Very large gaps appear between folders!

0C7A4643-3844-4675-A2CF-AAC99162BEBC.png

Like SmallDe likes this
Alvaro Castro
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 13, 2022

Hi guys,

 

I had the same issue so decided to install the latest version of Sourcetree instead, relaunched the app, and it worked as usual.

Was able to perform typical git actions using Sourcetree as before.

Hope it helps others to succeed this issue.

 

Best Regards.

rakslice October 20, 2022

I encountered this problem -- getting authentication prompts followed by "BitBucket cloud recently stopped ..." error -- in SourceTree 3.3.9, after changing my username and workspace id on the Atlassian site, and making the corresponding change in my project in SourceTree under Repository -> Repository Settings, updating the repository path and extended integration username, and then trying a fetch of that remote.

The problem appears to be that SourceTree doesn't have reasonable logic for what to do when there is an authentication failure for a Bitbucket remote -- it has logic to show a BitBucket branded login dialog, but it doesn't work, it attempts a password git login to the account which won't work -- the authentication failure means its authentication setup in SourceTree's account entry for Bitbucket is stale and should be redone.

 

As a workaround, you can easily redo the account entry manually: 


 

First make sure that the Path of the remote you're trying to use in SourceTree, which you can edit under Repository -> Repository Settings, is set to exactly the one suggested on the BitBucket web site at the end of the `clone` command you see when you go to the page for your project, click Clone, and then choose SSH or HTTPS from the dropdown to match whatever you're using.

In particular make sure the username part of it matches -- it doesn't matter how valid your auth to the site is if the you're trying to push to the project through a different account than the one you're actually logged in using, it's just not going to work.


1. Go to Tools -> Options, and go to the Authentication tab

2. Find the Bitbucket account in the list and click on it

3. Click Delete and confirm the deletion

4. Click Add. The "Edit Hosting Account" dialog will appear. Select "Bitbucket" from the Hosting Service dropdown if it isn't already, and then click on the "Refresh OAuth Token" button. This will pop up a browser window to log in to Bitbucket on the web if you aren't already. Then the Username field will fill in when the OAuth token is sent back to SourceTree. Click OK, and OK again to close the Options dialog.

Now that SourceTree's account entry for Bitbucket has the correct authentication details, you shouldn't be prompted for operations on that Bitbucket account again as long as these authentication details are still valid.

Like SmallDe likes this
KoliadaLLC
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 28, 2022

What a freakin' pile of unmentionable - I was happy working w. bitbucket but now whole schebang is a nightmare.

Sourcetree doesn't work and the latest changes to the web UI are incredibly bad - reminds me of why keyboards are laid out QWERTY.

This is very basic stuff, what are you guys smokin' over there?

KoliadaLLC
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 29, 2022

Where it says "IMPORTANT" - it is. I deleted everything mentioned there and reinstalled sourcetree.

Sourcetree is working now.

HOWEVER, I have to say the whole thing is still mind-numbingly complex/opaque. I tried setting up to use SSH (on a windows machine) and that doesn't work, so I set up an 'application' password but my web account still thinks I want to use SSH by default.

My problem here is that the whole configuration process of all these shenanigans is opaque. If it must be opaque, it better work flawlessly. Otherwise, if there was more (upfront) architectural information about the need for Putty (wtf), if the web UI was less opaque, blah blah.

There are so many UI paradigms that are unique to Atlassian/Bitbucket that, however good they are, they are a pain in the ass. And, however good they are, if they are not 'obvious by navigation', how good are they in reality (rhetorical).

Whatever else may be said in these regards, I'm still using bitbucket and will continue to do so, thx =:)

Like ianhawkdev likes this
Tomáš Bosák
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 29, 2022

Brut

Like SmallDe likes this
Vilfred Hebibasi
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 7, 2023

Hi everyone. I have faced the same situation regarding the authentication problem and here is how I solved it. Maybe this will help you as well.

Step 1: You can uninstall the Sourcetree for Windows and install it again, or you can update it to the latest version by going at Tools-Options-Updates. Maybe before that at Tools-Options-Authentication you can delete the existing Accounts (you will be asked to enter it again). After re-installing or updating the Sourcetree for Windows you will be asked for your account details, but the system will take them (username and password) automatically, because it seems they exists somewhere and Sourcetree takes them again. You can try to do a pull request, but it won't work.

Step 2: Create an App Password in BitBucket

- Go to the bitbucket.org website and log in with your account credentials
- From your avatar in the bottom left, click Personal settings
- Click App passwords under Access management
- Click Create App password
- Give the app password sufficient rights and a label related to the application that will use the password
- Don’t forget to save that password

Step 3:  Close Sourcetree for Windows

Navigate to C:\Users\<UserName>\AppData\Local\Atlassian\Sourcetree and remove the passwd file.

Step 4: Open Sourcetree for Windows. Make a Pull request. At certain point it will ask you for the credentials: username and password. You enter your bitbucket username, but instead of your bitbucket password, you must enter the App Password you generated in Step 2. Wait for a while (this waiting is only for the first time) and it will work fine.

It worked for me.

Like vmvm likes this
Vilfred Hebibasi
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 7, 2023

Hi everyone. I have faced the same situation regarding the authentication problem and here is how I solved it. Maybe this will help you as well.

Step 1: You can uninstall the Sourcetree for Windows and install it again, or you can update it to the latest version by going at Tools-Options-Updates. Maybe before that at Tools-Options-Authentication you can delete the existing Accounts (you will be asked to enter it again). After re-installing or updating the Sourcetree for Windows you will be asked for your account details, but the system will take them (username and password) automatically, because it seems they exists somewhere and Sourcetree takes them again. You can try to do a pull request, but it won't work.

Step 2: Create an App Password in BitBucket

- Go to the bitbucket.org website and log in with your account credentials
- From your avatar in the bottom left, click Personal settings
- Click App passwords under Access management
- Click Create App password
- Give the app password sufficient rights and a label related to the application that will use the password
- Don’t forget to save that password

Step 3:  Close Sourcetree for Windows

Navigate to C:\Users\<UserName>\AppData\Local\Atlassian\Sourcetree and remove the passwd file.

Step 4: Open Sourcetree for Windows. Make a Pull request. At certain point it will ask you for the credentials: username and password. You enter your bitbucket username, but instead of your bitbucket password, you must enter the App Password you generated in Step 2. Wait for a while (this waiting is only for the first time) and it will work fine.

anurag dhepe
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 19, 2023

I had to delete source tree files. Now its working. Thank you.

ianhawkdev August 16, 2023

It seems incredible that this problem is still around 18 months later. This problem started when I changed my bitbucket password. Since then I have not been able to push changes. I use bitbucket and github for different projects, and github still works, hence I am reluctant to delete all sourcetree files and start again in case I lose access to github also. 

Is there an updated description of what to do? 

Vedran Stanic
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 6, 2024

All i had to do was setup an app password with all rights i could click and delete that passwd file in the App Local folder people are saying. Then finally it asked me to enter a password again and it worked. Atlassian keeps raising prices and I just lost hours on this. This sucks. Just look at this instruction set. Are you insane?

uemil
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 23, 2024

Lovely, Atlassian slowly becoming like Microsoft, another company than can't make two of their own software or service compatible with one another. Why the hell make shit overcomplicated? Why do I need a password for every damn piece of code? Why would you make anybody to manage even more passswords? Dumbest move ever. Seriously considering making my self hosted git server, and just be done with it.

P Satish Patro June 7, 2024

I recently did the setup on my new office laptop. For every git operation, it asks for password

like when I do clone, fetch, pull, etc. It opens a popup saying 'Connect to bitbucket' and if I select 'sign with browser', it doesn't ask anything & it proceeds. If I select 'password/token', I write the credential & it works.

 

For 'sign with browser' it adds one extra git log line compared to 'password/token' which is 


fatal: Bitbucket DC OAuth Client ID must be defined



Please find below the command & git logs it generates when I do fetch operation


git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks fetch --tags origin
error: could not lock config file %USERPROFILE%/.gitconfig: No such file or directory
warning: failed to remember result of host provider detection!
warning: try setting this manually: `git config --global credential.https://tools.lowes.com.provider generic`

Completed successfully.


 

 I tried deleting all saved authentication. 

I tried deleting the 'passwd' file

 

Nothing worked. I am not able to find any solution. Please help at earliest

Kenneth_Hippolite June 28, 2024

SourceTree has somehow forgotten my app password (as have I) but it's still working on my other computers. Tempting as it is to try to copy those SourceTrees from AppData/local I'm back to tinkering.

Basically, 2 years + 3 months after this change, it continues to be a nightmare

Kenneth_Hippolite June 28, 2024

See: Some computers are still using it, just not this one.

SourceTree_In_Use.png

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events