Bug 1709 - GIT VERSION CONTROL AUTH FAILURE
Summary: GIT VERSION CONTROL AUTH FAILURE
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Version Control ()
Version: 2.8.1
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Alan McGovern
URL:
Depends on:
Blocks:
 
Reported: 2011-10-26 19:38 UTC by Shawn Lewis
Modified: 2012-02-14 10:27 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Shawn Lewis 2011-10-26 19:38:54 UTC
This bug may be a duplicate to #330 and #356, though I believe in 2.8.1 git enhancements were made.

When attempting to push/pull to say github, an authentication failure now occurs:

NGit.Errors.TransportException: git@github.com:NokNokLLC/XXX.git: Auth fail    at NGit.Transport.JschConfigSessionFactory.GetSession(URIish uri, CredentialsProvider credentialsProvider, FS fs, Int32 tms)    at NGit.Transport.SshTransport.GetSession()

This is happening on both MAC and WINDOWS.  .ssh is properly configered in the home directory, pub and private keys do exist.

From searching google I can not seem to find where/how/what key files MD is looking for.  My guess is, its not finding them, though they exist.

One possible solution to this  problem would be to allow a person to specific a KEY directory/file for MD to use for the project?

This is when the GITHUB url used is git@git.github.com.... Basically to repro:

Use ToroiseSVN to CLONE a github project.

Then go into MD, add that project to an existing solution.

Make a 1 line change.

Commit and Push, you will get the error.
Comment 1 Damian Ziemba 2011-12-12 04:04:03 UTC
Greetings.

I am having same problem on Linux box.

Whenever I try to pull or push changes, exception is risen.

Title of exception: 
git@bitbucket.org:nazriel/dragonov.git: Auth fail. git@bitbucket.org:nazriel/dragonov.git: Auth fail.

Details:
NGit.Errors.TransportException: git@bitbucket.org:nazriel/dragonov.git: Auth fail
  at NGit.Transport.JschConfigSessionFactory.GetSession (NGit.Transport.URIish uri, NGit.Transport.CredentialsProvider credentialsProvider, NGit.Util.FS fs, Int32 tms) [0x00000] in <filename unknown>:0 
  at NGit.Transport.SshTransport.GetSession () [0x00000] in <filename unknown>:0 
  at NGit.Transport.TransportGitSsh+SshPushConnection..ctor (NGit.Transport.TransportGitSsh _enclosing) [0x00000] in <filename unknown>:0 


If I change repo adress from git:// format to https:// other exception is risen:

Title:
Object reference not set to an instance of an object. Object reference not set to an instance of an object.

Details:
System.NullReferenceException: Object reference not set to an instance of an object
  at Sharpen.HttpURLConnection.GetResponseCode () [0x00000] in <filename unknown>:0 
  at NGit.Util.HttpSupport.Response (Sharpen.HttpURLConnection c) [0x00000] in <filename unknown>:0 
  at NGit.Transport.TransportHttp.Connect (System.String service) [0x00000] in <filename unknown>:0 
  at NGit.Transport.TransportHttp.OpenPush () [0x00000] in <filename unknown>:0 
  at NGit.Transport.PushProcess.Execute (NGit.ProgressMonitor monitor) [0x00000] in <filename unknown>:0 
  at NGit.Transport.Transport.Push (NGit.ProgressMonitor monitor, ICollection`1 toPush) [0x00000] in <filename unknown>:0 
  at MonoDevelop.VersionControl.Git.GitRepository.Push (IProgressMonitor monitor, System.String remote, System.String remoteBranch) [0x0005d] in /var/tmp/portage/dev-util/monodevelop-2.8.2/work/monodevelop-2.8.2/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs:921 
  at MonoDevelop.VersionControl.Git.GitService+<Push>c__AnonStorey14.<>m__1A (System.Object ) [0x00000] in /var/tmp/portage/dev-util/monodevelop-2.8.2/work/monodevelop-2.8.2/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitService.cs:70 


I tried it with various projects using GitHub, BitBucket and my private repo at Shell. It occurs with all types of solutions: C#, C++, D etc.


Here are details about my envirioment:
MonoDevelop 2.8.2
Build information:
	Git revision: 3ad243983f7219d98f534dbcf5731e3a15f77dff-dirty
	Build date: 2011-12-10 15:17:04+0000
Operating System:
	Linux 
	Linux d3 3.0.6-gentoo #1 SMP Sun Oct 9 12:00:00 CEST 2011 x86_64 Intel(R) Core(TM) i5 CPU M 450 @ 2.40GHz GenuineIntel GNU/Linux
Runtime:
	Mono 2.10.6 (tarball Wed Nov 30 23:28:36 CET 2011) (64-bit)
	GTK 2.24.8 (GTK# 2.12.0.0)
Loaded assemblies:
NSch                                       1.0.0.0        /usr/lib64/monodevelop/AddIns/VersionControl/NSch.dll
gconf-sharp                                2.24.0.0       /usr/lib64/mono/gac/gconf-sharp/2.24.0.0__35e10195dab3c99f/gconf-sharp.dll
MonoDeveloperExtensions_nunit              0.0.0.0        /usr/lib64/monodevelop/AddIns/MonoDeveloperExtensions/MonoDeveloperExtensions_nunit.dll
MonoDevelop.WebReferences                  2.6.0.0        /usr/lib64/monodevelop/AddIns/MonoDevelop.WebReferences/MonoDevelop.WebReferences.dll
MonoDevelop.AspNet.Mvc                     2.6.0.0        /usr/lib64/monodevelop/AddIns/MonoDevelop.AspNet.Mvc/MonoDevelop.AspNet.Mvc.dll
MonoDevelop.TextTemplating                 2.6.0.0        /usr/lib64/monodevelop/AddIns/MonoDevelop.TextTemplating/MonoDevelop.TextTemplating.dll
Mono.TextTemplating                        0.0.0.0        /usr/lib64/monodevelop/AddIns/MonoDevelop.TextTemplating/Mono.TextTemplating.dll
Sharpen                                    1.0.0.0        /usr/lib64/monodevelop/AddIns/VersionControl/Sharpen.dll
MonoDevelop.VersionControl.Subversion.Unix 2.6.0.0        /usr/lib64/monodevelop/AddIns/VersionControl/MonoDevelop.VersionControl.Subversion.Unix.dll
MonoDevelop.VersionControl.Subversion      2.6.0.0        /usr/lib64/monodevelop/AddIns/VersionControl/MonoDevelop.VersionControl.Subversion.dll
MonoDevelop.CodeMetrics                    2.6.0.0        /usr/lib64/monodevelop/AddIns/MonoDevelop.CodeMetrics/MonoDevelop.CodeMetrics.dll
MonoDevelop.Gettext                        2.6.0.0        /usr/lib64/monodevelop/AddIns/MonoDevelop.Gettext/MonoDevelop.Gettext.dll
ChangeLogAddIn                             2.6.0.0        /usr/lib64/monodevelop/AddIns/ChangeLogAddIn/ChangeLogAddIn.dll
MonoDevelop.CBinding                       2.6.0.0        /usr/lib64/monodevelop/AddIns/BackendBindings/MonoDevelop.CBinding.dll
MonoDevelop.D                              1.0.4361.34525 /home/naz/.local/share/MonoDevelop-2.8/LocalInstall/Addins/MonoDevelop.D.0.1.4/MonoDevelop.D.dll
D_Parser                                   1.0.4361.33591 /home/naz/.local/share/MonoDevelop-2.8/LocalInstall/Addins/MonoDevelop.D.0.1.4/D_Parser.dll
MonoDevelop.Projects.Formats.MSBuild       1.0.0.0        /usr/lib64/monodevelop/bin/MonoDevelop.Projects.Formats.MSBuild.exe
MonoDevelop.Autotools                      2.6.0.0        /usr/lib64/monodevelop/AddIns/MonoDevelop.Autotools/MonoDevelop.Autotools.dll
MonoDevelop.MsVisualStudio                 2.6.0.0        /usr/lib64/monodevelop/AddIns/MonoDevelop.MsVisualStudio/MonoDevelop.MsVisualStudio.dll
MonoDevelop.VBNetBinding                   2.6.0.0        /usr/lib64/monodevelop/AddIns/BackendBindings/MonoDevelop.VBNetBinding.dll
MonoDevelop.CSharpBinding                  2.6.0.0        /usr/lib64/monodevelop/AddIns/BackendBindings/MonoDevelop.CSharpBinding.dll
MonoDevelop.Refactoring                    2.6.0.0        /usr/lib64/monodevelop/AddIns/MonoDevelop.Refactoring/MonoDevelop.Refactoring.dll
Mono.Addins.Gui                            0.6.0.0        /usr/lib64/mono/gac/Mono.Addins.Gui/0.6.0.0__0738eb9f132ed756/Mono.Addins.Gui.dll
MonoDevelop.RegexToolkit                   2.6.0.0        /usr/lib64/monodevelop/AddIns/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit.dll
NGit                                       1.0.0.0        /usr/lib64/monodevelop/AddIns/VersionControl/NGit.dll
MonoDevelop.VersionControl.Git             2.6.0.0        /usr/lib64/monodevelop/AddIns/VersionControl/MonoDevelop.VersionControl.Git.dll
MonoDevelop.Moonlight                      2.6.0.0        /usr/lib64/monodevelop/AddIns/MonoDevelop.Moonlight/MonoDevelop.Moonlight.dll
MonoDevelop.AspNet                         2.6.0.0        /usr/lib64/monodevelop/AddIns/MonoDevelop.AspNet/MonoDevelop.AspNet.dll
MonoDevelop.XmlEditor                      2.6.0.0        /usr/lib64/monodevelop/AddIns/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor.dll
ICSharpCode.SharpZipLib                    2.84.0.0       /usr/lib64/mono/gac/ICSharpCode.SharpZipLib/2.84.0.0__1b03e6acf1164f73/ICSharpCode.SharpZipLib.dll
MonoDevelop.Deployment.Linux               2.6.0.0        /usr/lib64/monodevelop/AddIns/MonoDevelop.Deployment/MonoDevelop.Deployment.Linux.dll
MonoDevelop.Deployment                     2.6.0.0        /usr/lib64/monodevelop/AddIns/MonoDevelop.Deployment/MonoDevelop.Deployment.dll
Mono.Security                              4.0.0.0        /usr/lib64/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll
nunit.util                                 2.4.8.0        /usr/lib64/monodevelop/AddIns/NUnit/nunit.util.dll
nunit.framework                            2.4.8.0        /usr/lib64/monodevelop/AddIns/NUnit/nunit.framework.dll
nunit.core.interfaces                      2.4.8.0        /usr/lib64/monodevelop/AddIns/NUnit/nunit.core.interfaces.dll
nunit.core                                 2.4.8.0        /usr/lib64/monodevelop/AddIns/NUnit/nunit.core.dll
MonoDevelop.NUnit                          2.6.0.0        /usr/lib64/monodevelop/AddIns/NUnit/MonoDevelop.NUnit.dll
MonoDevelop.DesignerSupport                2.6.0.0        /usr/lib64/monodevelop/AddIns/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.dll
MonoDeveloperExtensions                    2.6.0.0        /usr/lib64/monodevelop/AddIns/MonoDeveloperExtensions/MonoDeveloperExtensions.dll
Mono.Debugging                             0.0.0.0        /usr/lib64/monodevelop/bin/Mono.Debugging.dll
Mono.Cecil                                 0.9.4.0        /usr/lib64/monodevelop/bin/Mono.Cecil.dll
pango-sharp                                2.12.0.0       /usr/lib64/mono/gac/pango-sharp/2.12.0.0__35e10195dab3c99f/pango-sharp.dll
MonoDevelop.VersionControl                 2.6.0.0        /usr/lib64/monodevelop/AddIns/VersionControl/MonoDevelop.VersionControl.dll
MonoDevelop.SourceEditor2                  2.6.0.0        /usr/lib64/monodevelop/AddIns/MonoDevelop.SourceEditor2.dll
MonoDevelop.Debugger                       2.6.0.0        /usr/lib64/monodevelop/AddIns/MonoDevelop.Debugger/MonoDevelop.Debugger.dll
monodoc                                    1.0.0.0        /usr/lib64/mono/gac/monodoc/1.0.0.0__0738eb9f132ed756/monodoc.dll
System.Drawing                             4.0.0.0        /usr/lib64/mono/gac/System.Drawing/4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
gnome-vfs-sharp                            2.24.0.0       /usr/lib64/mono/gac/gnome-vfs-sharp/2.24.0.0__35e10195dab3c99f/gnome-vfs-sharp.dll
gnome-sharp                                2.24.0.0       /usr/lib64/mono/gac/gnome-sharp/2.24.0.0__35e10195dab3c99f/gnome-sharp.dll
GnomePlatform                              2.6.0.0        /usr/lib64/monodevelop/AddIns/GnomePlatform/GnomePlatform.dll
System.Configuration                       4.0.0.0        /usr/lib64/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
Mono.Cairo                                 4.0.0.0        /usr/lib64/mono/gac/Mono.Cairo/4.0.0.0__0738eb9f132ed756/Mono.Cairo.dll
gdk-sharp                                  2.12.0.0       /usr/lib64/mono/gac/gdk-sharp/2.12.0.0__35e10195dab3c99f/gdk-sharp.dll
Mono.TextEditor                            1.0.0.0        /usr/lib64/monodevelop/bin/Mono.TextEditor.dll
atk-sharp                                  2.12.0.0       /usr/lib64/mono/gac/atk-sharp/2.12.0.0__35e10195dab3c99f/atk-sharp.dll
gtk-sharp                                  2.12.0.0       /usr/lib64/mono/gac/gtk-sharp/2.12.0.0__35e10195dab3c99f/gtk-sharp.dll
Mono.Posix                                 4.0.0.0        /usr/lib64/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/Mono.Posix.dll
Mono.Addins                                0.6.0.0        /usr/lib64/mono/gac/Mono.Addins/0.6.0.0__0738eb9f132ed756/Mono.Addins.dll
Mono.Addins.Setup                          0.6.0.0        /usr/lib64/mono/gac/Mono.Addins.Setup/0.6.0.0__0738eb9f132ed756/Mono.Addins.Setup.dll
System.Xml                                 4.0.0.0        /usr/lib64/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll
System.Xml.Linq                            4.0.0.0        /usr/lib64/mono/gac/System.Xml.Linq/4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll
System.Core                                4.0.0.0        /usr/lib64/mono/gac/System.Core/4.0.0.0__b77a5c561934e089/System.Core.dll
glib-sharp                                 2.12.0.0       /usr/lib64/mono/gac/glib-sharp/2.12.0.0__35e10195dab3c99f/glib-sharp.dll
System                                     4.0.0.0        /usr/lib64/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll
MonoDevelop.Core                           2.6.0.0        /usr/lib64/monodevelop/bin/MonoDevelop.Core.dll
MonoDevelop.Ide                            2.6.0.0        /usr/lib64/monodevelop/bin/MonoDevelop.Ide.dll
MonoDevelop                                2.6.0.0        /usr/lib64/monodevelop/bin/MonoDevelop.exe
mscorlib                                   4.0.0.0        /usr/lib64/mono/4.0/mscorlib.dll


I use 2 external Addins:
Debugger-GDB and bindings for D Programming Language. 


Best regards,
Damian Ziemba
Comment 2 Alan McGovern 2012-02-14 07:26:18 UTC
This ssh should be fully supported with the latest builds in git master, and probably the last few releases too. We read private keys from the ~/.ssh directory and either prompt for a password (if it's passworded) or retrieve it from the Keychain on MacOS if there is a password stored there. There is no keychain integration on windows or linux yet.

HTTPS is still throwing an exception when we attempt to push a commit. I am looking into this now.
Comment 3 Alan McGovern 2012-02-14 10:27:24 UTC
I just fixed the HTTPS issue which should be in the next release of MonoDevelop. The issue was that when the username was populated with a default value (detected from the https url), the username was not used in the rest of the code. You can work around this by modifying the value of the 'username' field by adding a letter and removing it if it contains a default value.