Overwhelming number of authentication dialogs when SourceTree sits idle
Asked by John Lewin:

If l accidentally leave recent builds of SourceTree running overnight, I arrive to hundreds of authentication dialogs tiled across the screen. Right clicking the toolbar icon and choosing \`Close all windows\` drops the current batch but then hundreds more start reloading. I have to repeat numerous times to restore order

**Environment**

SourceTree Version 3.0.6-beta-2193 but has been regularly occurring for a week or so

**Expected**

One dialog if authentication required

**Actual**

One dialog per SourceTree auto-fetch attempt![2018_10_10_14_35_35_Window.png](/t5/image/serverpage/image-id/34620iEA7546A93F1CFA13/image-size/large?v=v2&px=999 "2018_10_10_14_35_35_Window.png")


Answers:
author: jlewin
body: On a different work machine I upgraded to 3.0.8 during the brief window when it was available yesterday. I'm now running into similar behavior on this machine, albeit with a GCM rather than Bitbucket dialog. Frustratingly, my credentials don't work in this dialog but do work if I push/fetch from command line.

Again, it seems like SourceTree should be blocking until the dialog response concludes rather than spawning off all these processes asynchronously.

![sourcetree.png](https://community.atlassian.com/t5/image/serverpage/image-id/35849iE8F17F174559442E/image-size/large?v=v2&px=999 "sourcetree.png")

comments: author: Mike Corsaro
body: The dialog is coming from git itself -- it's trying to load remote repository details (Sourcetree attempts to refresh this every 10 mins which you can disable under Options) and is failing to do so which causes the prompt to appear. Not sure why it can't find your credentials and why your current one doesn't work. You'll probably need to log what the git-credential-manager is doing and find out why it can't find the credentials you're giving it.


author: jlewin
body: GCM works without issue at the command line. I can't see how the problem is on their end when it works as expected on the command line and only Sourcetree produces the problem behavior.

On the new machine that started acting up after I upgraded yesterday, I followed the advice listed below and removed the Sourcetree passwd file from AppData. So far it's again working as expected. From what I observed, it seems like your passwd file is having an unexpected effect on your authentication requests.

<https://community.atlassian.com/t5/Sourcetree-questions/Why-can-t-I-login-to-atlassian-via-sourcetree-while-have-no/qaq-p/920287>


author: jlewin
body: \>Not sure why it can't find your credentials and why your current one doesn't work

My credentials actually work. The dialog closes as you would expect on successful auth, but moments later I assume Sourcetree invokes a GCM request again because it's tracking the wrong state, or because of something in the passwd file that makes it assume auth failed.


author: John Lewin
body: I'm not entirely certain that SourceTree is responsible for these counts but it seems highly likely the Bitbucket login screens are related to the ophaned processes listed below. Before I reboot to try and make my machine usable again, the following seemingly orphaned processes are running after SourceTree and all applications are closed down:

git.exe: 762 instances  
conhost.exe: 385 instances

![2018_10_19_12_58_34_Window.png](https://community.atlassian.com/t5/image/serverpage/image-id/35514iDC6A8B46901016FD/image-size/large?v=v2&px=999 "2018_10_19_12_58_34_Window.png")

![2018_10_19_12_57_17_Window.png](https://community.atlassian.com/t5/image/serverpage/image-id/35515iD686F6CF6A104591/image-size/large?v=v2&px=999 "2018_10_19_12_57_17_Window.png")

comments: author: SaSa
body: After update from 2.6.10 to 3.0.6 my colleague and I had problems with sourcetree which was constantly asking for my password.  
I also detected lots of processes git.exe.

![problems with sourcetree v3.png](https://community.atlassian.com/t5/image/serverpage/image-id/35569iBAFCCA94A3D4F3E4/image-size/large?v=v2&px=999 "problems with sourcetree v3.png")

After reinstalling v2.6.10 there no problems and sourcetree works fine!


author: John Lewin
body: Same askpass error after running the GCMW-1.18.2.exe installer. It failed with the original error, and failed after a reboot and reload

![80.png](https://community.atlassian.com/t5/image/serverpage/image-id/35424iA3790C145FF3D4C5/image-size/large?v=v2&px=999 "80.png")

comments: author: Mike Corsaro
body: Seems like the GCM is not set to the be the credential manager for git. Can you run the following command via the terminal and reply with the output:

```
git config --global
```

You should be looking for:

```
credential.helper=manager
```

After doing that, can you open the Windows Credential Manager (go to 'Windows Credentials') and look for an entry with your username that looks something like "git:https://USERNAME@bitbucket.org" and verify that exists?

Additionally, can you verify that in Sourcetree the setting "Allow Sourcetree to manager my credentials via the Git Credential Manager" is checked (Tools \> Options \> Git)?


author: John Lewin
body: Really appreciate you continuing to think through this. My Bitbucket account may be at fault as at times in the past it also put up annoying dialogs that kept coming back after authentication. I usually go in and try to remove all cached credentials for Bitbucket after I connect to an old Bitbucket repo through Sourcetree (we moved to GitHub a few years ago). However, the new behavior is on a whole nother level and pretty much brings my computer to its knees if I leave Sourcetree open overnight.

GCM looks to be configured:![2018_10_19_15_16_16_Window.png](https://community.atlassian.com/t5/image/serverpage/image-id/35521i5308F6A3E6DDF856/image-size/large?v=v2&px=999 "2018_10_19_15_16_16_Window.png")

Allow Sourcetree to manage... is and was enabled.

![2018_10_19_15_20_22_Window.png](https://community.atlassian.com/t5/image/serverpage/image-id/35522i66070BAEAD0B764B/image-size/large?v=v2&px=999 "2018_10_19_15_20_22_Window.png")Still getting the AskPass error in Sourcetree on the non-public repository. Fetch works without issue from the command line. Fetch works in Sourcetree on public repositories


author: Mike Corsaro
body: Got it -- thanks. Okay, so in this case I'd recommend just removing all credentials related to Bitbucket from the Windows Credential Manager and then if prompted again enter your credentials and see if those get stored.

Regarding the missing AskPass exe -- we'll be shipping an update for that sometime next week. It's suppose to be deprecated due to the use of the GCM but it causes the git exe to hang forever. Sorry about that!


author: John Lewin
body: Oh, and I failed to follow up on the last part of your question. Yes cached credential entries exists in the Windows Credential manager for my Bitbucket account but as I mentioned, Sourcetree seems to be unable to use the cached credentials and often continues asking for Bitbucket auth for whatever reason. In the past this meant a single blocking auth dialog. This would drive me crazy but was just a quirk and bearable. When the dialogs don't block I get the hundreds of them.

I'll blow them away and see what happens


author: jlewin
body: This behavior has been occurring on my work machine which as of last night was configured with System Git 2.19.0. Based on your recommendations I upgraded Git to 2.19.1. Unfortunately I'm now running into a blocking bug I've previously commented on (AskPass Error: No error) which prevents SourceTree from syncing successfully on some of my repositories until I switch to Embedded Git.

I haven't yet seen the error dialog but things aren't in their typical state given the Askpass error. Further, the naming of the component under error (AskPass) strongly suggests that it may have been responsible for the problematic behavior to begin with. If the blocking bug gets fixed and the errors don't resume, this issue may be resolved as suggested.

**AskPass Error: No error**

<https://community.atlassian.com/t5/Sourcetree-questions/Error-Askpass-exe-No-such-file-or-directory/qaq-p/908286>  

**Work Config**

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/35208i74BD995CBBDF7D89/image-size/large?v=v2&px=999 "image.png")

comments: author: Mike Corsaro
body: That askpass error is happening due to the git-credential-manager-for-windows not being triggered. Could you download the latest version of that and see if it fixes it? You can find it here:

<https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases>


author: jlewin
body: I can do that, but shouldn't SourceTree work with the latest release of git? I'm on the absolute latest version of git for windows and running into this error like many others. I'll definitely try the new version though and report back


author: Mike Corsaro
body: Hello! This is probably an issue with the git-credential-manager-for-windows. I'd suggest downloading the latest version of git-for-windows, and making sure it installs the credential manager. Make sure Sourcetree is using 'System Git' (Options \> Git). Then try logging in via one of those dialogs and it shouldn't prompt again.