-
Notifications
You must be signed in to change notification settings - Fork 899
"Too many redirects or authentication replays" when pushing changes #1419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@jaccarmac Does it work with the latest 0.25 prerelease? If not, what does fiddler or wireshark show? |
Latest preview fails with "No error message has been provided". I'll get back to you on the Fiddler trace in a quick minute. |
OK. What kind of credentials are you trying to provide? What does your network infrastructure look like? Does your TFS server do kerberos or only NTLM? |
Hmm, I'm not totally sure, where in TFS do I check? I know there's no username-pw auth, it's all done through AD. And interestingly pull fails with a 401, so maybe I'm messing you an auth step. |
Currently just using DefaultCredentials |
There's a lot of ways that you could configure it, fundamentally it's in the IIS portal, but there's an easy setup option in the TFS admin itself. One last question: your client is also Windows, yes? Not some Unix of some sort? |
I'm connecting to TFS itself using the official C# API and the 0-argument VssCredential constructor so I assumed Git auth would be somewhat symmetrical. Can I extract something from my VSS connection to use as a Git auth token? It looks like LibGit2Sharp has its own cred type so there's no obvious way I can see to do so. |
To be explicit yes I'm on Windows, and TFS will accept my AD identity when I use the VSTS API. |
Just discovered a bug in my code as well that was causing the 401. Pull also generates a null error that LG2S can't make sense of. |
The request over HTTPS is a 401 according to Fiddler however. Apparently I am trying to anonymously access... |
However that same 401 occurs when I try to authenticate against TFS without Git so I may be misidentifying it. Now it looks like LibGit2Sharp isn't even establishing a connection with the server before failing. |
The NTLM or Kerberos handshake has several steps. There's back and forth and the server will provide more information (like a challenge) at each step, but with a 401 code. That you're seeing 401s is not indicative of a problem. Fiddler is a proxy (not a straight up packet filter like wireshark), so it's possible that it's changing the behavior by analyzing it. For example, Kerberos and NTLM must have a stateful connection in order to do this exchange. These problems are incredibly hard to diagnose. What's in the server logs? Anything? |
Don't have access to them at the moment unfortunately :/. I can Wireshark the connection if that would help, but I don't think Fiddler's interfering as the TFS API can query for work items through it. |
What's the exception that you're getting? You said it didn't have a message, but you didn't say what type of exception it was... |
LibGit2SharpException, thrown by HandleError in Core/Ensure.cs. Stack trace does not tell me what the parameter to that method was, but based on the code it looks like NativeMethods.giterr_last() is null at exception time. |
I believe I'm seeing the same issue when using DefaultCredentials. UsernamePasswordCredentials work. I was hoping to see a resolution from libgit2/libgit2#4453 but no luck. Here's the stack trace: LibGit2Sharp.LibGit2SharpException: No error message has been provided by the native library I also got a packet capture in Wireshark but not sure how to post it on here. |
Is there any update on this ticket? I can reproduce the issue as @mrdow pointed |
@rohitisinhk how did you solve it? |
This issue still occurs when using personal access tokens on Github... |
Hi,
have been search for this for a day and some people mentioned it is a bug.
I can clone, stage and commit, but the push always fails.
Command line push works fine
ClonedRepoPath = @"c:\temp\test"
_params.ClonedRepoPath = "http://172.16.40.129/test/Interfaces.git"
clone:
` if (!Directory.Exists(_params.ClonedRepoPath))
{
Directory.CreateDirectory(_params.ClonedRepoPath);
}
`
stage, commit and push
`
using (var repo = new Repository(_params.ClonedRepoPath))
{
if (repo.Network.Remotes.All(r => r.Name != name))
{
repo.Network.Remotes.Add(name, _params.ServerPath);
}
`
The text was updated successfully, but these errors were encountered: