VisualStudio icon indicating copy to clipboard operation
VisualStudio copied to clipboard

Can't login to GitHub

Open HisRoyalRedness opened this issue 9 years ago • 154 comments

NOTE: Updating to Visual Studio 2017 15.5.7 or later should fix this. See https://github.com/github/VisualStudio/issues/949#issuecomment-367821388

I'm having some trouble logging on to GutHib to push new changes to my repository. I've just recently upgraded to Visual Studio 17. Everything used to work on VS 2015, but doesn't any longer.

  • GitHub Extension for Visual Studio version: 2.2.0.8
  • Visual Studio 2017 Professional: Ver 15.0.0+26228.9
  • Windows 7 Pro SP1

Detailed steps:

  • I have a local clone of a public (personal) repository. I've made changes to the local files
  • Staged the changes.
  • Attempted to push the changes.
  • The GitHub login dialog appears. I've entered my username and password. I've confirmed that these are correct by logging in to the website.
  • I get the following in my ouput pane on Visual Studio
Opening repositories:
### Local path, removed the actual path to anonymise ###
Error encountered while pushing to the remote repository: Git failed with a fatal error.
fatal: AggregateException encountered.
   One or more errors occurred.
error: cannot spawn askpass: No such file or directory
fatal: could not read Username for 'https://github.com': terminal prompts disabled
Pushing to https://github.com/### repo path ###.git

I have 2 factor enabled on my account.

HisRoyalRedness avatar Apr 04 '17 01:04 HisRoyalRedness

Yes, the update fixed this.

pablodelolmo avatar Feb 23 '18 13:02 pablodelolmo

Updating fixed it here too.

mvinicius85 avatar Feb 23 '18 14:02 mvinicius85

Updating also fixed it here, thanks.

ytian2 avatar Feb 23 '18 15:02 ytian2

15.7 is a winner!

rfustino avatar Feb 23 '18 16:02 rfustino

thank you @meaghanlewis and @nimad !! GitHub was working just recently with 15.5.6 - the update today to 15.5.7 helped tremendously for the error: cannot spawn askpass: No such file or directory message today!

gojimmypi avatar Feb 23 '18 22:02 gojimmypi

In the future regarding breaking changes a better error message along the lines of security settings invalid would be better instead of cannot spawn askpass: No such file or directory which caused me to spend wasted time trying to debug what I assumed to be a corrupted install (because since when do executable suddenly vanish normally?).

lloydjatkinson avatar Feb 24 '18 04:02 lloydjatkinson

@avelis26 update to 15.5.7 to fix

gojimmypi avatar Feb 25 '18 23:02 gojimmypi

I saw that and thanks... that worked.

avelis26 avatar Feb 25 '18 23:02 avelis26

-1: No admin rights - cannot install any updates... should work - no sysadmin wide and far - f****d ...

git remote set-url origin username:[email protected]/username/repo.git

is therefore what works for me. Note: this will store your github-pw as plaintext in ./.git/config

Thanks github, now I'm that much safer... - love you PS: that's sarcasm

@microsoft: Why does TLS 1.2 need a Visual Studio Update ? :bomb: :bomb: :bomb:

ststeiger avatar Feb 26 '18 09:02 ststeiger

Thanks @nimad, updating my VS worked.

austinhargis avatar Feb 26 '18 14:02 austinhargis

Thanks everybody! Now it works!

bollafa avatar Feb 26 '18 18:02 bollafa

I Work To 2:00 AM,Tell me ,because version Question ? what?????

NobleKiss avatar Feb 27 '18 06:02 NobleKiss

The issue here is that Visual Studio bundles their own git.exe and (based on the above comments) the version prior to 15.5.7 was a piece of junk. I have git 2.16-x64 installed so I don't need their version. The fix for me (without updating to 15.5.7) was to delete this folder --

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git

rdefulio avatar Feb 27 '18 21:02 rdefulio

Followup on my previous post ... If you can't install the update right now..

GoodGit = C:\Program Files\Git BadGit = C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git

BadGit is found first by visual studio, unless you edit your visual studio options and remove the CommonExtension folder from the search path.

[C:\]dir git.exe /s/b/a
C:\Program Files\Git\bin\git.exe
C:\Program Files\Git\cmd\git.exe
C:\Program Files\Git\mingw64\bin\git.exe
C:\Program Files\Git\mingw64\libexec\git-core\git.exe
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\cmd\git.exe
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\bin\git.exe

After deleting the bad git folder, make sure running git.exe from the command prompt finds the correct version via the system path.

[C:\]git --version
git version 2.16.2.windows.1

But probably the right way to do it would be to remove git from this section of Tools-->Options, seen here.

image

rdefulio avatar Feb 27 '18 21:02 rdefulio

This issue was fixed for me by updating to the latest 15.5.7 and installing the Git For Visual Studio extension again. Sorry I don't have more specifics! It was as easy as it sounded.

AlexanderJ-ULabs avatar Feb 27 '18 23:02 AlexanderJ-ULabs

GitHub Extension 2.4.2.1331 VS 2017 15.5.7

And getting this when trying to do commits now. I've been able to push without issues until today. Not sure what's changed. Still investigating.

A task was canceled. cannot spawn askpass: No such file or directory could not read Username for 'https://github.com': terminal prompts disabled

UPDATE: I installed the Git Cred Manager, didn't fix it. I deleted my GitHub login in the Cred Manger in Control Panel under Web and so far I've been able to make commits. image

KevinDuganJr avatar Feb 28 '18 18:02 KevinDuganJr

Because we're not running on the command line this fails with error: cannot spawn askpass: No such file or directory, which is a very unhelpful error message.

Also in this department of unhelpful error messages, I love that this reports the exception type name instead of the exception message, stack trace, or something actually meaningful.... "AggregateException encountered" =<

StingyJack avatar Mar 01 '18 03:03 StingyJack

@StingyJack: That's all the info you get on the command line. No stack trace. And yes, the error message is very unhelpful. That has something to do with the programmer, though, not the reporter.

In fact, sometimes it just outputs nothing at all (while it says "look in the output tab") - but still fails - seems to be a visual studio issue, too. Sometimes message, sometimes blank. Same error. That's like when you switch to the "error tab" and look for compiler error 1 of 0.

ststeiger avatar Mar 01 '18 08:03 ststeiger

Also in this department of unhelpful error messages, I love that this reports the exception type name instead of the exception message, stack trace, or something actually meaningful.... "AggregateException encountered"

Yes I agree, the error message is not helpful. I'm tagging some of the Team Explorer people here so they're aware of this thread: @kaylangan @clboles @jeremyepling

Thanks for everyone's input on this!

grokys avatar Mar 01 '18 11:03 grokys

Could commit but couldn't push. Upgraded Git for Visual Studio and didn't help. Then upgraded to VS 15.5.7 and it worked again.

benmccallum avatar Mar 03 '18 13:03 benmccallum