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

146 comments

Alastair McQueen 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 May 23, 2022

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

Muhammad Asif 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 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 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 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 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 September 7, 2022

now it's not working~ i am a newbie

Like SmallDe likes this
Rob Farthing 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 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 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 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 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 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 November 29, 2022

Brut

Like SmallDe likes this
Vilfred Hebibasi 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 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 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 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?

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events