Can't login to GitHub
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.
I have a similar problem, but the login fails verifying the 2FA code and never completes the login.
@HisRoyalRedness is this still happening to you? If it is - the credentials are stored in the Windows Credential Manager, so perhaps something happened that cleared them. Could you open Credential Manager, go to Windows Credentials, and check the Generic Credentials list to see if you have two entries that look like the following:
git:https://github.com
https://github.com/
Apologies also for the delay in replying, this got missed somehow 😕
@richardmatsu Could you check the log in %localappdata%\GitHubVisualStudio\extension.log and see if you have messages in it that are similar to issue #958?
Nope, nothing like that. For kicks, I deleted my saved credentials in Credential Manager but no difference.
2017-04-24 15:09:36.1679|INFO|thread: 1|RepositoryHost|Log in from cache for login '(null)' to host 'https://api.github.com/' FAILED 2017-04-24 15:09:36.1679|INFO|thread: 1|RepositoryHosts|Log in to GitHub.com host 'https://api.github.com/' with username '****' FAILED
I've got nothing stored in my Credential Manager. Nothing in the log looks similar to #958
@HisRoyalRedness we're a bit stumped here to be honest. Would it be possible to run Fiddler and take a look at the requests that are being sent?
Also, are you still getting these errors?
error: cannot spawn askpass: No such file or directory fatal: could not read Username for 'https://github.com': terminal prompts disabled
These look like low-level errors unrelated to GHfVS. Does your git commandline work?
Hi there,
Yes, I still get those errors. I can fetch and pull from the commandline without any trouble.
I'm working on getting some Fiddler dumps for you
On 27 April 2017 at 09:50, Steven Kirk [email protected] wrote:
Also, are you still getting these errors?
error: cannot spawn askpass: No such file or directory fatal: could not read Username for 'https://github.com': terminal prompts disabled
These look like low-level errors unrelated to GHfVS. Does your git commandline work?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/github/VisualStudio/issues/949#issuecomment-297551777, or mute the thread https://github.com/notifications/unsubscribe-auth/ADH1yBVes-Tqiwb9EQUq6Avd5qmXINClks5rz7wvgaJpZM4MyRzj .
OK, perhaps I should have checked this in the first instance ... :-)
It seems that the extension is having some trouble getting through our corporate proxy. I've got the requisite global git entries.
git config --global --list http.proxy=127.0.0.1:8088 https.proxy=127.0.0.1:8088
I have CNTLM installed locally to do the NTLM auth through the corporate proxy. Complicated, I know...
git & other apps --> CNTLM Proxy (127.0.0.1) --> corporate proxy --> web
I can operate through the command line, so the config must be OK. These same settings appear in the VS git extension (under Repository Settings), and are shown as global settings.
When I attempt to sync my repository through the VS extension, I get the 'cannot spawn askpass' errors, and Fiddler shows auth errors from the corporate proxy. Could it be possible that the extension is ignoring the git proxy settings and picking up the proxy from Internet Options (which would be the corporate proxy)?
@HisRoyalRedness did you get any further with this issue? Apologies for not replying earlier, but we were unable to repro here.
Yup, still the same behaviour. Generally I stage and commit from Visual Studio, and push and pull to/from remotes from the command line using the standard Git tools. Yes, it's a pain, but I manage to get by with this workflow.
I've since upgraded to a new PC, running Windows 10 (old one was Windows 7), upgraded to Visual Studio 2017, and I still get the exact same error from Git (i.e. error: cannot spawn askpass).
Git command line works fine.
Hey guys - just landed on this page trying to search for this same issue (VS2017, behind corp firewall but with correct HTTP and HTTPS proxies set in my environment variables). I am able to use Git add-in for VS2017 to connect to my GitHub account and clone my repositories but when I try to push a change via VS Git add-in, I get the same error as HisRoyalRedness (cool username btw ;)). Any luck establishing a root cause and/or a fix/workaround?
@HisRoyalRedness @MuqadderIqbal so the problem occurs when pushing/pulling from team explorer? Are you able to log into GitHub using the Team Explorer "Connect" section, as described here?
https://github.com/github/VisualStudio/blob/master/docs/getting-started/authenticating-to-github.md
When you've logged in there, a dialog shouldn't appear when pushing and pulling.
@grokys I am able to successfully connect to my GitHub repo and authenticate. I am also able to successfully clone my library. However, after committing a change, an attempt to push it to GitHub repo results in an error. Here is the error stack trace:-
Opening repositories: C:\MyGithub\Learn-Pandas Commit dea72b81 created locally in repository C:\MyGithub\Learn-Pandas Error encountered while pushing to the remote repository: Git failed with a fatal error. HttpRequestException encountered. An error occurred while sending the request. cannot spawn askpass: No such file or directory could not read Username for 'https://github.com': terminal prompts disabled Pushing to https://github.com/MuqadderIqbal/Learn-Pandas.git
@grokys Ditto for me. I can connect and authenticate to GitHub. I can see the list of my repositories from within Visual Studio. Just can't push or pull. My error message is a little different. This was after attempting a pull
Git failed with a fatal error.
fatal: TaskCanceledException encountered.
A task was canceled.
error: cannot spawn askpass: No such file or directory
fatal: could not read Username for 'https://github.com': terminal prompts disabled
And this after a push:
Opening repositories:
C:\Users\KeithF\Source\Repos\HBusLogger
Commit b85c226f created locally in repository C:\Users\KeithF\Source\Repos\HBusLogger
Error encountered while pushing to the remote repository: Git failed with a fatal error.
fatal: TaskCanceledException encountered.
A task was canceled.
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/HisRoyalRedness/HBusLogger
If I push from a command prompt (just the standard Windows cmd, not git bash), I'm asked to enter my user name and password, and the push succeeds
C:\Users\KeithF\Source\Repos\HBusLogger>git push
fatal: TaskCanceledException encountered.
A task was canceled.
Username for 'https://github.com': HisRoyalRedness
Password for 'https://[email protected]':
Counting objects: 22, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (22/22), done.
Writing objects: 100% (22/22), 2.93 KiB | 1.46 MiB/s, done.
Total 22 (delta 18), reused 0 (delta 0)
remote: Resolving deltas: 100% (18/18), completed with 6 local objects.
To https://github.com/HisRoyalRedness/HBusLogger
92d8346..b85c226 master -> master
OK, I've got it working now. I thought I'd try get some Fiddler traces for you, couldn't get it to work through Fiddler (with the complex arrrangement of corporate proxies and my local CNTLM proxy, its no wonder), and then put it all back together again. Then hey presto, it all just worked!
So, I'm guessing that I got one of these steps wrong at some point. Anyway, this is what I did
- Verified that CNTLM was configured correctly. Other apps use this, so I was certain it was set up correctly. I've got CNTLM accepting connections at 127.0.0.1:8088, and passing them on to the corporate proxy with the appropriate Window logon details.
- Set global proxy settings. I had repository and global settings applied. I've removed the repository settings and it seems to work with just the global ones (as it should)
git config --global http.proxyhttp://127.0.0.1:8088`git config --global https.proxyhttps://127.0.0.1:8088`
- Confirmed that the config file at
%USERPROFILE%\.gitconfighad the correct settings. I can't remember if it did or not. I did edit the file while trying to get Fiddler working - Created the HTTP_PROXY and HTTPS_PROXY environment variables. Something required them. Not sure if it was the Visual Studio Github extension or something else
I can now push and pull from my repository
I've got a sneaky suspicion that I configured my https proxy setting with an http url. I did notice this when messing with the settings and corrected it. I've since set it back to http to see if I could get it to fail again, but was unsuccessful. Something to check anyway if you still have problems
Hopefully it all continues to work. I'll post an update in a day or two.
Glad you got it working @HisRoyalRedness. As I suspected, it was a proxy issue. Does the information above help you @MuqadderIqbal?
One thing to note is that GitHub for Visual Studio doesn't actually supply the git push and pull functionality - this is part of Team Explorer, so if the login works then the problem was actually on Microsoft's side.
I'm going to close this issue now as it looks like there's a fix and it's also not actually our functionality that's exhibiting the problem.
I faced the same issue guys, it appears when I have only TLS1.2 enabled on my PC. After enabling TLS 1.1, SSL.x the issue was resolved. For enabling and disabling I used IISCrypto software. Hope that helps the team and other users.
Thanks for letting us know @vCillusion - that will be helpful information for anyone experiencing this problem in future. Looks like we might need to look into why this is the case, maybe we can fix it on our end. I've opened an issue to track this over in #1443.
Thanks @HisRoyalRedness My email was wrong in here %USERPROFILE%.gitconfig Corrected and now is working like a charm.