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

155 comments

Sean Cull March 15, 2022

Why do some users have a password file and some not ?

Can you tell Sourcetree not to use Windows Credential Manager ?

Adam Spencer
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 15, 2022

Poorly written, doesn't work, please fix this.  

Doesn't matter I'm going to Kraken.

Edit:  I spent hours trying to work this out in in SourceTree, with Kraken it took 10 minutes to get up and running. 

Like # people like this
Mark Jeffery
Contributor
March 15, 2022

Hey, @bwebchris , you say you figured it out by creating an App password in Bitbucket and using that. How do you do this? Do you have any instructions? Like you, I didn't see this mentioned anywhere: Atlassian told us that we need now to use an App password, but they didn't give us so much as a clue as to how to do it. Thanks!

And Atlassian, this is a MASSIVE fail. You made a change that broke _everything_, without giving us _any_ instructions as to how to unbreak it. This is essential infrastructure for most developers, and it's halted my development entirely. How can we ever trust your products again?

Like Nick Gallant likes this
Nick Gallant
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 15, 2022

I can't believe what a cluster $#@! this is.

Like Robert Karlsson likes this
Mark Jeffery
Contributor
March 15, 2022

I've followed all the instructions, including uninstalling and reinstalling Sourcetree, and now I've lost access to all my repositories.

No matter whether I use OAuth or Basic authentication, whether I refresh the OAuth token or refresh the App password I created, it gives a green check mark and Authentication OK message, but all my repositories are gone.

What am I supposed to do? Please _help_, Atlassian!

TrainLayout March 15, 2022

Jumped through all the hoops before March and now I can't authenticate...

Does not give us confidence that security is somehow being improved when it does not work anymore at all.

adkehn
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 15, 2022

Gracie S's solution worked for me. what a ridiculous error, thanks Atlassian for severely affecting my job.

Like Gracie S likes this
Ketan Panchal March 16, 2022

I have tried following these steps alongside some of the suggestions in the comments and just not having any luck. A lot of comments say to delete the 'passwrd' file, however I don't have this file at all. 

When I try to follow this path to find the so called 'passwrd' file (C:\Users\<computername>\AppData\Local\Atlassian\SourceTree), I only see these files... I have searched through all folders and cannot find this file.

Screenshot 2022-03-16 131104.png

I tried to uninstall and reinstall and for some reason, it remembered all my account info and repositories etc which I didn't expect, so it didn't work.

Can someone please help and it's really hindering my ability to work as it is for others.

Thanks!

Lukas Wallner
Contributor
March 16, 2022

The folder of the password is hidden. You need to set hidden files visible first.
Show hidden files (microsoft.com)

Like Ketan Panchal likes this
Ketan Panchal March 16, 2022

Thank you @Lukas Wallner  - once I deleted this file and entered the app password created, it started working again.

For those still struggling with this, in order to delete the 'passwd' file you need to first set hidden files as visible > Show hidden files (microsoft.com).
Once you have deleted the file, Sourcetree will open a pop-up prompting you to enter a password for your account. This is where you need to enter the App password you created. 
Following that, try pulling/pushing, and hopefully with any luck it should be working for you.

Thanks again!

Sean Cull March 16, 2022

Even with hidden files enabled I have no password file.

I can get it to work using an app password but I have to edit the account, and save having made no changes, before my repos appear.

Vincent Miller
Contributor
March 16, 2022

I have uninstalled and re-installed SourceTree many times, deleted the 'passwrd' file, created an app password in BitBucket, and authorized the SourceTree app in BitBucket, but I am still getting the same error message.  I have been working on this for hours!  Help is appreciated. Thank you.

Adam Spencer
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 16, 2022

This is a bug with Sourcetree.  It can be resolved by not using Sourcetree.  GitKraken is a great git client, really easy to use and has an integration with Bitbucket that couldn't make the process easier.  Unfortunately it costs money after the trial.  There are lots of other git clients out there, VS Code works with git as well.  Also the command line is an option. 

Like John Bates likes this
John Bates March 16, 2022

I thought I was out of the woods with this. I was all working fine this morning, but I just went to another projects repo and my command like is broken. It gives me "the message" and then pops up a Atlassian password login box.  I tried both my Atlassian app password and my Bitbucket app password but it always gives the same response.  

λ git fetch
fatal: ArgumentOutOfRangeException encountered.
Specified argument was out of the range of valid values.
Parameter name: resultType
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1) 

 

Update: I went in to my windows credential manager and edited all the Atlassian credentials pasting my  app password in each. Then tried the command line again, it failed and I pasted app password in Atlassian and git-for-windows pop ups. Then it proceeded to fetch!

FYI: My repos had different protocols on the remotes, one was git@bitbucket and the other https://user_name@bitbucket. So I must have cloned one from Source tree and the other from the command line..

David Dansby
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 16, 2022

@Vincent Miller just to be clarify before we try other things, when you re-authorized/connected your Bitbucket Cloud account did you use your Bitbucket Cloud username as the username (can't use email as username with app password) and used the new app password as the password (and ensured it was copied over correctly)? Also did you try any of the other 2 suggested authentication methods? OAuth is typically easier/quicker and does not require an app password.

Mark Jeffery
Contributor
March 16, 2022

Here's how I finally worked around this issue.

I followed all the instructions above, right through to uninstalling, deleting all data and reinstalling Sourcetree, but it still didn't work!

It doesn't say anything about this above, but first, you need to create an app password in Bitbucket (why Atlassian didn't include a bullet-point how-to on this in the original emails, we'll never know):

  • go to https://bitbucket.org/account/settings/app-passwords/
  • create an app password called Sourcetree
  • check all the permissions (I don't know which permissions you actually need, but checking them all works)
  • keep a copy of the app password (you'll need it later and you won't be able to get it back once you've closed the dialog)

Then do a clean reinstall of Sourcetree:

  • backup all Sourcetree files & folders in
  • C:\Users\<UserName>\AppData\Local
  • C:\Users\<UserName>\AppData\Local\Atlassian
  • C:\Users\<UserName>\AppData\Roaming\Atlassian
  • use Windows > Settings > Add or remove programs to uninstall Sourcetree
  • delete all Sourcetree files & folders in
  • C:\Users\<UserName>\AppData\Local
  • C:\Users\<UserName>\AppData\Local\Atlassian
  • C:\Users\<UserName>\AppData\Roaming\Atlassian
  • reinstall Sourcetree from https://www.sourcetreeapp.com/

When you launch Sourcetree, you'll be taken through linking it to your Bitbucket account.

When you first link it to your Bitbucket account, if you're not already signed in, you'll have to sign in with your Atlassian/Bitbucket password, or whatever authentication you usually use to sign into Bitbucket.

But from then on, whenever you're asked for a password, use the app password you created above.

Once you're into Sourcetree, you'll need to set authentication to use the app password:

   Tools > Options > Authentication > [your Bitbucket account] > Edit
     Hosting Service
       Bitbucket
     Host URL
       https://bitbucket.org
     Preferred Protocol
       HTTPS
     Authentication
       Basic
     Username
       [your Bitbucket account username]
     click the Refresh Password button
       enter the app password you created above

I tried using OAuth rather than Basic authentication, but I couldn't get that to work.

There are so many bugs in Sourcetree that I had to run through the complete uninstall/reinstall cycle half a dozen times before it finally worked. And I had to set up all my repositories in Sourcetree from scratch, re-cloning the repositories from Bitbucket. So this was a huge drain on my time and it shut down my business for a day.

But it's worth persisting. Having to start from scratch in GitHub would have taken far longer.

Atlassian, this is a monumental fail. Never do this to us again. If you're going to force us to switch to a new authentication method, make sure it actually works first. And maybe give us step-by-step instructions next time, rather than leave us to figure it out for ourselves? Even better, don't do it in the first place. This has not improved security: I've had to downgrade from OAuth to Basic authentication, and give the app password full permissions, because you didn't bother telling us what permissions it needs. My confidence in trusting my code to Atlassian is thoroughly shaken.

Like # people like this
Vincent Miller
Contributor
March 16, 2022

@David Dansby 

The piece of the puzzle I was missing was when SourceTree requested a password to BitBucket use the app password and not my BitBucket account password.

Thank you David!  I finally got SourceTree working!

Like David Dansby likes this
Garrett Gustafson
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 16, 2022

@Pawel Ciochmassive thanks to you! The official "workaround" didn't work for me (including uninstall/reinstall), this did.

Ashraf Amin March 16, 2022

@ilhamhe method worked for me after setup App Password. Many thanks bro ! ^_^ 

https://<Bitbucket_Username>:<App_Password>@bitbucket.org/<Repo_Name_Path>.git

peakms
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 16, 2022

I love Atlassian.... but seriously this is a cluster of biblical proportions.  

I removed the passwd file... and used the app password and this kinda works.  I say kinda because now each time to do a push or pull... I have to re-authenticate each time.  

My crystal ball tells me that doing this over and over leads to early death.

Can the good people at Atlassian please find a solution ASAP before my crystal ball prophecy comes true.

SmallDe
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 17, 2022

Had issues with this today also - My list of how to rectify.

Log into Bitbucket, go to Personal settings, App Passwords, revoke any you have set.

Go into App Authorizations and revoke any you have granted permissions to.

Go back to App Passwords and create a new one, copy the password and save it local for later use.

Download the latest version of sourcetree.

Open sourcetree and go to Tools/Options/Authentication and delete any accounts, close sourcetree.

Navigate to folder c:\users\<username>\AppData\Local\Atlassian\SourceTree and delete file Passwd.

Install sourcetree which should just launch your current version, go to Tools/Options/Authentication and add a new account, Authentication will be OAuth, click Refresh OAuth Token, this will launch BitBucket and ask you to authorise and set permissions for your app settings, grant every tick box.

Back to sourcetree, go to Tools/Options/Authentication and add a new account, Host:bitbucket.org, your username (not email) Authentication: Basic, Protocol HTTPS and refresh, now enter your saved app password from earlier.

Hopefully it authenticate ok!

m1-scott March 17, 2022

Except for the last ditch effort of backing up your directories and uninstalling nothing worked for me. Then they don't tell you what you're supposed to do to restore what you backed up so now I have to manually add back all my repos. Then of course they don't tell you after you've added your account in the auth section of options that when it prompts for your password when trying to pull/push to a repo it's asking for your app password NOT your account password. Yay, another hour of productivity wasted on this nonsense, god this sucks! 

emmett.brosnan
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 20, 2022

So frustrating.

I dont know why this is so difficult.

It seems like authenticating with Atlassian is always an issue.

This time I have tried numerous ways - and cannot clone a repo.

Rediculous. 

Like SmallDe likes this
Luca Renoffio
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 21, 2022

Solved when deleted "passwd" file!

 

Thanks a lot!

Like # people like this
rogergoh
Contributor
March 21, 2022

Hi Everyone, the accepted answer in this thread worked for me. Upvote if it works for you too so others can see.

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events