It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Sourcetree 2.6.10 ArgumentException encountered. An item with the same key has already been added Edited

Any action in source tree 2.6.10 on Windows 10 is giving me the errors listed below.

It used to work fine with Bitbucket and VSTS, but it started to give this error, and action is completed, but now it is totally unworkable:

The following output is from Sourcetree's Fetch All action

git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks fetch origin


fatal: ArgumentException encountered.
   An item with the same key has already been added.

fatal: ArgumentException encountered.
   An item with the same key has already been added.

fatal: ArgumentException encountered.
   An item with the same key has already been added.

fatal: ArgumentException encountered.
   An item with the same key has already been added.


git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks fetch vsts

fatal: ArgumentException encountered.
   An item with the same key has already been added.

fatal: ArgumentException encountered.
   An item with the same key has already been added.

fatal: ArgumentException encountered.
   An item with the same key has already been added.

fatal: ArgumentException encountered.
   An item with the same key has already been added.

fatal: Authentication failed for 'https://xxxxxxx.visualstudio.com/DefaultCollection/xxxxxxx/_git/yyyyyyy/'
Completed with errors, see above.

 

I have replaced the name of the project and name of repository with xxxxx and yyyyy

I have done all the known tricks such as Upgrading GIT to the latest, enabling GIT Credential Manager, use Windows 10 Credential Manager to delete the existing credentials. Uninstall Sourcetree and delete the Atlassian and Sourcetree folders … all the known tricks, still getting same errors

I have tried to use the native GIT GUI 2.19.1 and managed to FETCH, PULL and PUSH on the repositories successfully. I have tried different repositories successfully.

The issue is related to Sourcetree and not to GIT or GIT Credential manager.

 

 

17 answers

This issue is not related to the git version but only to the version of Git Credential Manager. I installed git 2.19.1 which includes GCM 1.18.0 and throws the mentioned errors. After downgrading GCM to 1.17.2 everything is working fine. So something has been done in GCM release 1.18.0 that is not compatible to sourcetree 2.6.10.

Like # people like this

THANKS! Although the link from Richard seems to be broken, simply downloading and installing GCM 1.17.2 fixed it for me!

https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/tag/v1.17.2

Like # people like this

Thanks @Rolf B. Your tip worked for me too.

Thanks @Christian Franzen and Rolf B, it worked for me!

Thanks @Rolf B, you're fix worked for me too.

Thanks, this worked for me.

Like # people like this

cheers, did it for me.

Like # people like this

Was juggling 8 atlassian instruction pages most the day yesterday and this was the final thing to get it working with the new App password system for me.  Just installing GCM 1.17.2 exe file and then running sourcetree again got everything back to normal.  

I'd been getting endless pop-ups to log into my bitbucket account, but I think that was related to the updates from bitbucket.   Eventually got this working after also following some SSH key generation and installation instructions    

Don't save the key in a folder that has spaces in its name!

Ran into this issue today.

Updating to Git 2.19.2 instead of downgrading fixed it for me.

Thanks @Rolf B, you're fix worked for me too. 

Downloading and installing GCM from the above link worked for me.

New version of Git for Windows is available: 2.20.1. Install it and be happy (it fixes the problem)!

Ohh Thanks...! Mr. Richard and Mr. Rolf

It is easy way for fix my problems.

 

Follow below steps :

1) Go to the https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/tag/v1.17.2

2) Download the ''GCMW-1.17.2.exe'' file and install it your window machine.

3) Take pull/push 

4) Pop up the authentication dialog.

5) Enter your git credentials.

6) Then it will be working well.

Thanks. That worked for me

I encountered the same errors with a GitHub repository after upgrading to Git 2.19.1 (I'm using the System Git in SourceTree).

I've now downgraded to Git 2.19.0, which seems to have resolved the issue.

Many Thanks for your reply.

I tried to switch to the Embedded version and it addressed a big part of the problem.

  • At least I am able now to interact with the Bitbucket Repository, though I am still getting the same annoying message but only 1 occurrence, instead of 4.
  • Your solution addressed the issue completely with VSTS. It is working with no errors.

So, apparently GIT 2.19.1 is not supported with Sourcetree.

If only we can know this before hand, we could have saved about 6 hours of trial and errors.

The issue seems to be solved with Git 2.19.2

I started to have this issue, when I upgraded my git 2.19.1. So I reverted it back to 2.19.0 and the issue went away.

I don't why, but Source Tree have some kind of incompatibility with newer git version

It is the updated Git Credential Manager that it has a conflict with.

2 votes
minnsey Atlassian Team Nov 07, 2018

GCM 1.18.3 has been released with a fix for this issue https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/tag/1.18.3

It will take a few days for it to work through to a Git for Windows release.

This worked for me, thanks!

Like Spike McLarty likes this

Worked for me too

Worked for me too

This version (1.18.3) worked for me too.

1 vote
minnsey Atlassian Team Oct 08, 2018

Hi 

I know you say its not a Git or GCM issue, but that error is being thrown by the GCM.

If you are still getting the error can you open the Terminal from Sourcetree in this repo and try running the same command.

git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks fetch origin

If you get the same error can you then run

git credential-manager version

Can you let me know the results?

Many Thanks for taking care of my issue. Greatly appreciated.

Here are the results:

xxx@yyyyy MINGW32 ~/Documents/Visual Studio 2017/Projects/zzzzz (E060Prep)
$ git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks fetch origin
fatal: HttpRequestException encountered.
   An error occurred while sending the request.
fatal: HttpRequestException encountered.
   An error occurred while sending the request.

 

It then prompts me to enter (OpenSSH) password for bitbucket account, though I am not using OpenSSH at all.

 

$ git credential-manager version
Git Credential Manager for Windows version 1.16.1

 By the way, I managed to get around (partially) the complete failure of reaching my repositories, by using the trick of switching to the Embedded version of GIT. So, it looks that GIT 2.19.1 is having problems with Sourcetree 2.6.10

I even tried to upgrade to Sourcetree 3.0.3 and the situation got more complicated, as it started to give me one more error on AskPass missing, which I opened a different ticket for it, and they confirmed that they have a release problem that they will fix for AskPass.

So, my workaround situation now that I have returned back to 2.6.10 with the Embedded GIT, and if I do a Fetch action on any repository, I get now one Annoying message, but it actually completes the action.

Please note that now with the Embedded version of GIT, the command syntax has an additional option to invoke the GIT Credential Manager which was not the case before with GIT 2.19.1, so it looks you are right, the issue is in-between the integration of Sourcetree and GIT.

Please note that with VSTS the Embedded version is working flawlessly.

 

git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks -c credential.helper= -c credential.helper="C:/Users/admin/AppData/Local/ATLASS~1/SOURCE~1/GIT_EX~1/GIT-CR~1.EXE" fetch origin


fatal: HttpRequestException encountered.
   An error occurred while sending the request.


git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks -c credential.helper= -c credential.helper="C:/Users/admin/AppData/Local/ATLASS~1/SOURCE~1/GIT_EX~1/GIT-CR~1.EXE" fetch vsts


Completed successfully.
 

So, with the Embedded version, all Actions are completing with one time error with Bitbucket that does NOT stop the actual action from completing

fatal: HttpRequestException encountered.
   An error occurred while sending the request.

And with Visual Studio Team Services, it is working flawlessly.

minnsey Atlassian Team Oct 22, 2018

The Askpass error will be fixed in upcoming v3.0.8

I have opened a ticket with GIT folks  Here ..

while using git 2.19.0 version with source tree 2.6.10, source tree continuously asking for atlassian username and password and authentication keeps failing. when i try to upgrade my git version to 2.19.1 im facing  'An item with the same key has already been added.' error.

could you please let us know the appropriate compatible versions. 

Hi everyone,

 

Just wanted to add..

I had the same issue, sourcetree 2.6.10 with git 2.19.1 not working, as soon as i revert to 2.19.0 everything started to work again.

 

HOWEVER! I have a friend with 2.6.10 and 2.19.1 and it works for him, he was on 2.19.0 and upgraded and he is also working with the system version and not embedded.

 

FYI

I am having the same problems here. What's going on? Embedded git makes it happen to (v2.17.1)

Same problem here and same workaround as above: reverting system Git back to v2.19.0.

Updating Sourcetree/embedded Git didn't work for me. Hope there will be a solution to this soon!

0 votes
minnsey Atlassian Team Oct 22, 2018

Hi 

It looks like there is a bug relating to Bitbucket in the GCM v1.18.x bundled with Git 2.19.1

We will see what we can do.

Can confirm that downgrading worked perfectly, went from 2.19.1 to 2.19.0 and its fine now. Thanks for looking into it @minnsey

@minnsey As Rajesh pointed out there is currently no working solution.

With Git 2.19.1 we can't push. When downgrading we keep getting spammed with login prompts, despite the fact that stored credentials are correct.

You seriously need to sort this out, as your product is completely useless in its current form.

Did you try downgrading to GCM version 1.17.2? That is what worked for me.

After downgrading, sign out of any web-based git managers. Sign back in.

 

https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/tag/v1.17.2

I downgraded to 2.19, which means GCM 1.17.1. I haven't tried installing 1.17.2 however.

But we have been riddled with this bug for ages, and have yet to receive an answer from Atlassian on how to fix it.

Did you report it in the Sourcetree Bug Reports?
This is the Questions area.

 

Atlassian monitors this area but will definitely respond quick if you report a bug.

Same problem on source tree 3.0.8 using system git 1.19.1

GIT Credential Manager folks are releasing a Fix for this problem. It is committed to master branch already, so I guess it will soon be released.

Look at here for more details

Anybody tried GCMW v 1.18.x recently? Have the issues been fixed?

I am still using v 1.17.2 as I used to have issues with v1.18.x when cloning from a private GitHub repository.

I was able to resolve this by upgrading git for windows from 2.18 to 2.21
Sourcetree is set to use system git instead of embedded.

0 votes

pusherror.PNGi got this problem when i push

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Sourcetree

Sourcetree for Windows - CVE-2019-11582 - Remote Code Execution vulnerability

A vulnerability has been published today in regards to Sourcetree for Windows.  The goal of this article is to give you a summary of information we have gathered from Atlassian Community as a st...

1,632 views 0 10
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you