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

I was having the same problem. Upgraded to VS 15.5.7 and it worked again.

LeftHandedTacos avatar Mar 04 '18 04:03 LeftHandedTacos

Upgrading to VS 15.5.7 also solved the problem for me.

vivienchevallier avatar Mar 04 '18 19:03 vivienchevallier

I was facing the same issue on both VS2017 and GIT Bash. Upgrading to VS 15.5.7 has fixed both. Thanks all.

AnuragLalithambikai avatar Mar 05 '18 14:03 AnuragLalithambikai

Upgrading to VS 15.5.7 fixed it last week. Now the same error is back. Now what? Geez I hate how much time Visual Studio wastes. It's the opposite of what it's supposed to do!

Error encountered while fetching: Git failed with a fatal error. TaskCanceledException encountered. A task was canceled. cannot spawn askpass: No such file or directory could not read Password for 'https://[email protected]': terminal prompts disabled

UPDATE: Updating the Git Credential Manager then rebooting fixed it. I'm still pissed that I spent 20 minutes finding this solution and VS 15.5.7 didn't tell me this in the first place. Typical. https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/tag/v1.14.0

nkev avatar Mar 19 '18 00:03 nkev

@nkev, there was a Git extension for VS update I saw last night, wonder what that was for. Anddoes it update Git credential manager under the covers...? Will see if mine is broken today after updating the ext last night :p

benmccallum avatar Mar 19 '18 09:03 benmccallum

Fixed for me as well by upgrading VS2017 Old Version: 15.5.2 New Version: 15.6.2

Also note in the 15.6 release they've added more Git support: "We added support for Git authentication over SSH. You can configure continuous delivery for solutions under source control in a VSTS or GitHub Git repo with SSH AUTH enabled."

https://docs.microsoft.com/en-us/visualstudio/releasenotes/vs2017-relnotes#15.6.2

lmoxiel avatar Mar 19 '18 09:03 lmoxiel

It's silly that we have to update the whole VS for incremental updates. It takes half an hour on my machine and I'm reluctant to do it for every release.

nkev avatar Mar 19 '18 22:03 nkev

I have the same issue, now can i fix it without reinstall anything?

shtse8 avatar Mar 20 '18 12:03 shtse8

@shtse8 you don't have to reinstall, you just need to update Visual Studio.

grokys avatar Mar 20 '18 12:03 grokys

Upgrade VS from 15.3.3 to 15.6.4 -> now able to push to github !

Wallonman avatar Mar 26 '18 20:03 Wallonman

Updating Visual Studio did the trick for me too!

chrisgel15 avatar Mar 27 '18 14:03 chrisgel15

I have VS 2017 version 15.6.4, GitHub.VisualStudio version 2.4.3.17 and GitBash version 2.16.1.windows.4 I am facing the same issue while trying to pull using VSTS Git Hub extension.

I am behind corporate proxy, configured through CNTLM, I verified git config --global, the correct username, email and proxy address is configured for http and https.

While logging in VSTS does ask username, password and 2 factor authentication code then connects, then when trying to pull it shows the following exception in VS output window, can anyone please help

Git failed with a fatal error. HttpRequestException encountered. An error occurred while sending the request. cannot spawn /C/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer/Git/mingw32/libexec/git-core/git-askpass.exe: No such file or directory could not read Username for 'https://github.com': terminal prompts disabled

SanjibKHarchowdhury avatar Apr 02 '18 12:04 SanjibKHarchowdhury

I had the same problem. After updating to the latest VS, problem is fixed. Still, error message is really confusing.

aperwe avatar Apr 03 '18 19:04 aperwe

Try to set username and password to your Remote url in repository settings. Remotes: https://username:pass@github.com/Username/Repo

Maximres avatar May 06 '18 15:05 Maximres

I had same issue. In my case for some reason on my laptop, when I have my VPN on, no Windows universal type apps can connect to the internet. Edge for example cannot, while chrome and Firefox run fine. Same deal with Windows weather and news apps. Curiously, the live tiles can still update, but opening the app it says no connection.

It seems this part of Visual Studio must use similar code, because when I turned my VPN off, it works fine.

I use the same VPN account and credentials on my desktop machine, and it works fine - same version of Windows 10, too. This issue is something to do with windows. At some point a Windows 10 major update fixed it, but then it got broken again.

cactusoft avatar May 24 '18 18:05 cactusoft

Had the same issue, Seems windows store the credentials in a strange way. All i did to fix was the following... cd C:\location\of\project git config credential.helper store git push http://example.com/repo.git

At this point it will fail and ask fro crentials:

Username: <type your username> Password: <type your password>

Then i could push from visual studio. Hope this helps :)

TheJaysH avatar Jul 03 '18 10:07 TheJaysH

Had the same issue and noticed i didn't update in a while.

Update Visual Studio and now it works. Thanks.

Fieel avatar Jul 07 '18 11:07 Fieel

Broken for me still in 15.4.7

EDIT: The "real" solution ended up being importing my ssh keys from my other dev environment, caching them in Pageant PuTTY authentication agent and closing the repo via SSH rather than HTTPS. Was not able to solve the HTTPS / two-factor auth issues with VS, Atlassian and Windows Credentials.

Error: cannot spawn /C/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer/Git/mingw32/libexec/git-core/git-askpass.exe: No such file or directory
Error encountered while pushing to the remote repository: Git failed with a fatal error.
could not read Password for 'https://[email protected]': terminal prompts disabled
Pushing to https://[email protected]/blahblahblah/blahblahblah.git

I have tried clearing all credentials from Windows credentials manager, but they do not appear to be getting recreated into the credentials manager when I sign back into Atlassian.

I cannot find any GitCredentialsManager directory on my system, even though I have enabled the display and search of hidden files and system directories, so no tenant.cache file that I can delete to try and resolve, either.

Have executed git config and am not seeing any proxies, although I am running Windows from a Parallels VM. Any other internet connectivity is working fine though, including auth... credentials just aren't getting stored. No enterprise network settings on my machine, etc. again, two-factor auth was working not too long ago.

When I try to execute the following from the command-line:

git config credentials.helper store git push origin ...

It took over a minute to respond and ask for my password. The VS process definitely doesn't last very long. Although, the error I'm getting when it finally completes is very different. The response I get is that SSH is recommended and if I use HTTPS then I need to login with the app password.

ghost avatar Jul 07 '18 16:07 ghost

I've got Visual Studio 2017 v15.7.4 installed in a school for my students to use git to manage their programming projects. I've got the GitHub for VS plugin version 2.5.3.2888. Cloning, committing and pushing all works fine for 'normal' GitHub repos but fails when using the private organisation account that we need for school assessments (so they don't cheat!)

Here's the error:

Error encountered while cloning the remote repository: Git failed with a fatal error.
ArgumentNullException encountered.
   Value cannot be null.
Parameter name: path
cannot spawn /C/Program Files/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer/Git/mingw32/libexec/git-core/git-askpass.exe: No such file or directory
could not read Username for 'https://github.com': terminal prompts disabled

My students don't have admin privileges or access to a command line / git terminal. Can anyone help me get this working? They're 32bit Win7 computers so I can't install GitHub Desktop on them.

Many thanks!

pddring avatar Jul 13 '18 12:07 pddring

@Pritchard @pddring can you update to Visual Studio 2017 v15.7.5 and let us know if you continue to have problems?

meaghanlewis avatar Jul 13 '18 21:07 meaghanlewis