1
votes

Same problem here: Error encountered while cloning the remote repository with VS 2015 Update 3 (TFS 2015 Update 3)

But that solution doesn't work for me. Please read the full question.

I received the following error when I tried to clone TFS git repository:

Error encountered while cloning: An error occurred while sending the
request.

Inner Exception:
    The remote server returned an error: (401) Unauthorized.

    Inner Exception:
        No credentials are available in the security package

I did not find any other log details.

I verified that I am able to access TFS repository on the web. I can also clone using Git bash. So it seems to be a problem with Visual Studio storing my credentials.

as per the solution mentioned here, I don't want to delete all credentials for different TFS servers I am connected to.

  1. I have https://tfs.CodePlex.com/tfs TFS credentials
  2. I have my personal https://myAccountName.VisualStudio.com credentials and
  3. I am now connected to my company's tfs http://ipAddress:8080/tfs credentials

First two works fine, I can any time switch to those accounts from Team Explorer but the 3rd one is not working.

Not sure, how to trouble-shoot it

3
If you lead by saying "same as this other question". do you think maybe you'll end up with this question marked a dup? Is there some reason the answer in the question you linked isn't applicable?Mark Adelsberger
@MarkAdelsberger yes. As I explained in my question. Answer in that question it not applicable. I would not want to lose all mt TFS credentials which are working. I want to fix the one which is not working.HaBo
Yeah, reread your question and still don't see where you're making that clear. If you're expecting other users (like myself) to really study both your question and the previous question and answer, good luck with that. It's your job to make it clear if you want people to help.Mark Adelsberger
sure will highlight thatHaBo

3 Answers

3
votes

401 Unauthorized:

If the request already included Authorization credentials, then the 401 response indicates that authorization has been refused for those credentials.

Just as your guess, this may be a problem with Visual Studio storing my credentials. You could first give a try with clear VS cache.

If it's not work, you may need to change the account info which cached in VS for your company's TFS credentials. Unlike VSTS, you can't switch user or log out directly for on-premise TFS. enter image description here

You have to delete the account info in Windows-Control Panel- Credential Manager. You could give a try with only deleting the company's TFS credentials which based on TFS link address.

enter image description here

You may have to remove any tfs related credentials if it's still not working. No need to worry about other two servers, what you have to do is just re-entering your account info/password for them.

0
votes

Finally this is how I resolved the issue

  1. TFS site was using only NTML authentication I added Negotiate on top it and removed anonymous access.
  2. I had a second issue not able to access the TFS site via domain name and was only accessble via IP address. To enable domain name access instead of IP address, I added registry keys for “DisableStrictNameChecking” and “DisableLoopbackCheck”.
0
votes

In my case i was connecting to TFS from my TEST domain where NETBIOS name matched but fully qualified name was different.

When logging in with NETBIOS\username it failed auth. when logging in with FQDN\username it succeeded.