Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Sourcetree asking for password again and again

manuege
Contributor
January 16, 2018

Since last update (2.7 152), source tree ask for my username and password every few seconds (around 30), making the app unusable. A modal window is shown in the front of the app, and it keeps appearing even if I enter the right password. 

 

How can I solve this?

8 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

6 votes
Scott Yelich
Contributor
April 12, 2018

I didn't read all the comments -- if this has already been said, I apologize for the duplication.

 

MY assumption of what's going on here is that somehow the sourcetree internal git is fubared in some way.  Let's say internal is 2.15.1 -- but my system one is 2.15.1.  Somehow, they are not behaving the same with regards to at least authentication.

Again, this is an assumption here, and I will test with the next set of sourcetree updates, but I think when an update or a certain level of update for sourcetree comes out -- the setting for which git to use gets cleared or (re)set to internal git.  THIS CAUSES ME ALL KINDS OF GRIEF.

In the comments here, there are posts that say that the command line git works.  This is and always has been the case for me.  I "resolve" the sourcetree shenanigans by going to the preferences for git and selecting to use the system git (even if it's the same version).

This has resolved the issue of sourcetree repeatedly asking me for my password and having the input of a valid password not working.   I did not erase passwords in keychain, unlock keychain, save to keychain, use command line once, uninstall or re-install sourcetree -- I just changed the git to command line git (and restarted sourcetree just because).

 

YMMV.  Good luck.

 

Scott

Hiren Bhalgama
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!
June 21, 2018

It's working

Thanks

faridyagubbayli
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!
June 5, 2020

This solved the issue for me as well. I tried other things but this is the only one worked for me. Thanks!  

Samir Pipalia
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 16, 2020

This has always been a problem and I never knew why, thank you so much. Just changing the embedded git to system resolved the issue for me straight away. I tried everything including OAuth but nothing worked and I never received a password prompt either, which was annoying since I couldn't find the setting to enable it. But just changing the git to System fixed all issues. Thank you for saving hours worth of work.

Shivam Jaiswal
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 9, 2021

worked for me 

Deleted user January 10, 2023

worked for me, Thanks :) 

1 vote
Kirk Richardson
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 29, 2021

What ended up working for me, using OAuth on Mac w/ Sourcetree v4, was to find my github-related credentials in the Keychain Access list, deleting them, restarting the OS. Recreating the github credentials with Sourcetree, granting Sourcetree access with the "always allow" option when prompted, and then verifying by clicking on the github credential that Sourcetree had access to it.

Nick Leone
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 18, 2022

This worked for me, thanks! 

1 vote
Richard Schilling March 14, 2021

This is an old thread. But I'm having the same issue in Sourcetree 4.1.0 (237).

I'm stuck. Does anyone have any suggestions on how to resolve this issue in the latest version?

Richard Schilling March 15, 2021

My less than ideal workaround is to add the key to the agent using ssh-add and then push and pull from the command line. 

I would like to be able to use the UI for this though. So, any suggestions would be helpful. 


Thanks.

Like Eric Tsang likes this
0 votes
Robert B August 7, 2020

It seems that there can be a different cause for the issue.

I'm on 3.3.4, win10. After a time off, got this issue. I use ssh key to connect to gitlab and suddenly SourceTree was not able to identify a key, and kept asking annoyingly for credentials. 

Solution for me was to make sure correct configuration is set, and it was:

Tools-Options->General

SSH Client Configuration: "SSH key path" path where certificates are and "SSH Client" i changed to "OpenSSH".ssh_issue.jpg

All works fine now.

Daria Zaika
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 31, 2022

Thank you so much, that worked for me!

0 votes
Zakharii Veremei
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!
April 23, 2020

I use the Google Account as authorization and have similar problem. So it is need to refresh OAuth token.

In SourceTree navigate: Tools > Options > Authentication Tab.

Then expand your bitbucket account and select Edit. 

After that press Refresh OAuth token button.

0 votes
Manju
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 13, 2018

Hi All,

Sincere apologies for the issues you have been facing with regards to authentication on Sourcetree Mac over the last few months. Please read the response from the product manager of Sourcetree here - https://community.atlassian.com/t5/Bitbucket-questions/Authenticating-with-Bitbucket-not-possible/qaq-p/502460#M25871

Also, I have submitted an issue on JIRA - https://jira.atlassian.com/browse/SRCTREE-5600 and have been working on getting it fixed. We will hopefully have a fully functional build very soon.

 

Thanks,
Manjunath
Sourcetree Mac Developer

scott davis July 3, 2018

I am getting this repeatedly on 2.7.6.   Very frustrating after update.  By getting this, I mean when connecting for any pull or push to github using a connected github account (of which the 'connect account' process works perfectly)

 

Please help!   Very tired of putting in my password repeatedly every push or pull.  (note, my ssh key has a passphrase on it.   this never used to happen with previous versions of sourcetree)Screen Shot 2018-07-03 at 11.43.56 PM.png

Hiren Bhalgama
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 4, 2018

Hi,

I have solved by changing configuration :

Preferences -> Git tab -> Select 'Use System Git'

 

Thanks!

scott davis July 4, 2018

that doesn't work for me.  (version  2.7.6.  )

Manju
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 6, 2018

Can you please remove the account if its added in Sourcetree, remove any remnant keychain items for GitHub and add the account again and see if that works?

scott davis July 11, 2018

That still does not work.

scott davis July 11, 2018

I also tried deleting the other github keys in keychain (used by other apps).

 

This is new for me in this version.  Previous versions did not have this issue.

scott davis July 15, 2018

I should be clear though, the password it is asking for is the passphase on my private ssh id_rsa.  This didn't used to be a problem though....   is there something else I need to do so this works?

Manju
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 16, 2018

There are some changes in the OpenSSH on macOS that causes these issues. More details can be found in Apple's Technical Note - https://developer.apple.com/library/content/technotes/tn2449/_index.html

Every time you restart the Mac, check if the keys are loaded to the agent and if not, load them manually. This would just work fine with Sourcetree.

To check if key is loaded, use this command

ssh-add -l 

To load keys, use this command

ssh-add <path_to_key> 

e.g.,

ssh-add ~/.ssh/id_rsa 

 

scott davis July 16, 2018

Thank you Manjunath,

 

I did verify with `ssh-add -l` that the key is loaded.  I also added the key again as described.

 

However the issue remains the same in asking me for the key (shared secret) with every push/pull/etc.

Manju
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 17, 2018

Alternately, can you try using HTTPS authentication? 

scott davis July 30, 2018

I don't want to have to use HTTPS in this case.

 

What ended up working was editing my .bashrc with the following:


eval `ssh-agent`
ssh-add -K ~/.ssh/id_rsa

 

solved my problem.  no idea if this is a clean solution.

movildrive
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!
April 3, 2019

Not working for v3.0.1

 

What should I do?

Michael Spears April 3, 2019

I've moved onto GitKraken... issue never came up again.

Like # people like this
manuege
Contributor
April 4, 2019

Michael Spears:

I've moved onto GitKraken... issue never came up again.

 

I did the same more than one year ago. The solution worked like a charm. 

Like Kirk Richardson likes this
0 votes
Kevin Truong
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 29, 2018

Same thing happens to me.  Tried everything here to no avail.  Delete 2.7.1 and redownloaded 2.6.3 and I am back in business.  Good job 2.7.1.

Tomas Dermisek
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 24, 2018

to me this is happening on 2.6.3 - I don't think it is the version's problem

0 votes
Manju
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 16, 2018

Can you please include a screenshot and describe what host you are trying to connect, protocol for the remote URL and if you also have an account added in Sourcetree?

Thanks!

manuege
Contributor
January 16, 2018

Here is an screenshot. You can see three modal windows. The three are asking for the same password. These modals appears randomly every few seconds.

It is asking the password for an account which I defined in the sourcetree accounts, but it is not even the account owner of any of the repos which I am managing at this moment. I don't think it is related, but the repo url protocol is https. And the host is bitbucket.

 

Thanks :)

 

Captura de pantalla 2018-01-16 a las 15.00.01.png

Manju
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 16, 2018

This seems to happen on macOS High Sierra when you have for some reason denied access to a keychain item to Sourcetree and we cannot read keychain items. Here are a few things that got the issue resolved for me personally,

  1. Remove account in Sourcetree
  2. Remove all keychain items added by Sourcetree
  3. Restart Mac 
  4. Add the accounts back in Sourcetree 
  5. Make sure to enter password and click "Always Allow" when keychain prompt is displayed for the new keychain items. 

Let me know if this helps!

Like # people like this
manuege
Contributor
January 17, 2018

Thanks for the answer, but it didn't work. 

It makes my computer unusable. If I have source tree running in background I get those annoying prompts asking me for the password again and again, whatever is the app I am using in the foreground. 

manuege
Contributor
January 18, 2018

Even after I deleted that account from SourceTree, it is asking me for the password all the time. 

Michael Spears January 18, 2018

This same thing happens to me after updating to 2.7 (152).  I'm on OS X El Capitan, everything was fine prior to this update.  This now causes my Bitbucket server to require a CAPTCHA frequently.  Can't use Sourcetree until it's fixed.

Manju
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 18, 2018

@manuege@Michael Spears

Sourcetree tries to check if there are commits that needs to be pulled for you in the background and hence you see the prompts when the account isn't available. As I mentioned, please add the account back and confirm that sourcetree has written to keychain to make sure this works for you. If for some reason, you don't see keychain items after saving the account, please restart your mac once. 

Should you have more trouble, I'm happy to work with you personally to get these issues resolved. Happy to help anytime. Thanks for your patience. 

manuege
Contributor
January 18, 2018

 I deleted all the items in my keychain related with source tree and added the accounts back. Then some items are added into the backlog again. Still, a few mins later I see all those prompt again. 

Michael Spears January 25, 2018

Deleting the items in my keychain didn't work, I'm still being asked for my password.  I did try a git fetch from sourcetree, this was the error:

Something went wrong. one or more parameters required to renew token is nil

Manju
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 25, 2018

I recommend you to try out our 2.7.1 beta which has potential fixes around authentication and provide feedback. You can download the beta here - https://bitbucket.org/atlassianlabs/sourcetree-betas/downloads/OSX_Beta_Latest.zip

To providing feedback, please file tickets in https://jira.atlassian.com/browse/SRCTREE whenever you hit a problem and make sure to add the “trusted_tester” label so we can investigate ASAP.

Michael Spears January 26, 2018

That link you provided doesn't work.

Going back to 2.6.3 fixed my problem.

Like drake.wang likes this
Manju
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 26, 2018

I've corrected the link.

Thanks!

Roland Heusser February 6, 2018

@Manju the displayed link is correct, but if you click it there's a malformed Google Analytics link behind it.

 

I have the same issue with SourceTree as @manuege and @Michael Spears describe. I will briefly tried out the beta, but also ended up reverting to 2.6.3.

SourceTree Archive: https://www.sourcetreeapp.com/download-archives

Roland Heusser February 6, 2018

@Manju I think there's a trailing dot after the `.zip` extension that breaks the link.

 

`.zip.` instead of `.zip`

Manju
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 7, 2018

I've corrected the link. 

The password prompt would come up only if Sourcetree can't find a saved password. 

Can you delete files with the format <username>@STAuth-<host> under ~/Library/Application Support/SourceTree/ and add the account once again to see if this helps?

When you add the account, it should write the file back to app support folder. If not, there is some permission issue accessing keychain at which point I would recommend a restart of mac to see if the permissions are corrected. 

Roland Heusser February 7, 2018

Hello @Manju

Thanks for your response.

In one of my debugging attempts I removed SourceTree completely with AppCleaner, which deletes the Application Support folder as well. I also deleted all keychain entries that were related to SourceTree.

The only thing I didn't do was rebooting the Mac or I am not certain anymore. 

Since 2.6.3 is working fine for me and the problem only occurs with the newer versions, I will keep using the old ones for now. 

 

Also – not sure if Apple changed anything related to the keychain in High Sierra, but I am still using Sierra (10.12.6).

Manju
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 7, 2018

Hi @Roland Heusser

After restart, did you check if the ssh keys are loaded to the agent?

Apple changed a lot of stuff related to ssh in 10.12. You can read the note here - https://developer.apple.com/library/content/technotes/tn2449/_index.html

This is the primary reason why ssh breaks for all users whenever they restart the mac. The note also has some tips to load the keys automatically but that hasn't worked for e personally. You can give it a try yourself and see if it works for you. 

However, what surprises me is the fact that this happens with 2.7 only while there isn't any real change in the ssh key handling for 2.6.3 and 2.7 versions of Sourcetree. I'm on it to figure out why this happens. 

Thanks!

Roland Heusser February 7, 2018

Happy hunting for the cause 😉

Tarik Soliman March 20, 2018

Did anyone find a good solution to this? I am using OSX Sierra 10.12.6 and Sourcetree 2.6.3 and am encountering this problem repeatedly as well.

Like edwardvlad likes this
Tarik Soliman March 20, 2018

Maybe a clue - everything was working fine until I installed Git 2.1.62. I reverted, alas the problem remains. Instructed Sourcetree to use System Git. No dice.  

Tarik Soliman March 21, 2018

Took a deeper look and was able to solve the issue with the info here: https://developer.apple.com/library/content/technotes/tn2449/_index.html

Restarted, back to normal

Like Joachim Deelen likes this
Joachim Deelen
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!
December 6, 2018

Adding

Host github.com

     IdentityFile ~/.ssh/id_rsa

     UseKeychain yes

to the file ~/.ssh/config solved the problem for me. 

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events