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.
@meaghanlewis I am having same issue and error as @pddring with Visual Studio 2017 v15.7.5
I can fetch a brand new branch and connect to a repository, however unable to fetch/push commits
We began having the same issue with Atlassian's own software, SourceTree using BitBucket HTTPS connections. We've quickly moved our teams to use SSL only from hereon. This is resolving the issue across all teams - some using Visual Studio, some not.
I will debug next time we run into a an issue isolated to Visual Studio environments, but I consider this resolved as not being a bug with VS itself.
@Maximres Your solution (https://github.com/github/VisualStudio/issues/949#issuecomment-386886010) worked for me. Nothing else before worked. :)
This started here after I have updated Visual Studio to version 15.7.6. I cleared my bitbucket credentials and re-entered them but the results is still the same. :(
Git integration with VS not working anymore. Only command line tools. Any action to git from VS - problems with credentials. Any action from command line working as should. Fun is that yesterday everything was working good and from yesterday no changes on system (no updates, no reset or restart VS) What else can Microshit destroy ?
Same as the above 2 - another VS update (15.7.6) and git integration broken yet again. Can push via command line but not in VS. I can do fetches ok, but not push. Very frustrating!
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 /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 Password for https://xyz : terminal prompts disabled pushing to https://xyz
And again fun is that this askpass.exe is there in the correct place :) I know where is problem we all are using Microsoft system and software :)
If you're unable to push, this is a problem with Team Explorer's git integration rather than GitHub for Visual Studio. @clboles @kaylangan @jeremyepling any idea?
Use command line, everything working fine.
It has started to happen to us as well out of nowhere with no changes in the environment at all. Git with VS doesn't work, but git in command line works fine. The solution of hard-coding the password in the remote settings (https://github.com/github/VisualStudio/issues/949#issuecomment-386886010) fix this issue, but it's very insecure to store a password in plain text like this.
@SimonSDA @AmosHason @TymekMM @richardmatsu JedatKinports could check your local disk and determine if "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\libexec\git-core\git-askpass.exe" actually exists or not?
I'm trying to determine if this is a Visual Studio installer issue or something else. Thanks! 🙇
@whoisj It does exist.
I actually gave up and configured SSH key authentication, and now Git works with VS without any issues, but this issue still needs to be fixed.
I just upgraded to 15.7.6 and I'm having the same issue. Configured SSH key authentication, but Visual Studio integration still not working. The "git-askpass.exe" does indeed exist at the path mentioned in the error message as not existing.
@whoisj Any other ideas?
I'm using Bitbucket, BTW.
To those who are having this issue, capturing additional trace logs would be very useful towards discovering the root cause and resolving the issue. To enable tracing...
- Open Command Prompt
- Run
setx GIT_TRACE %UserProfile%\git.log. - Run
setx GCM_TRACE %UserProfile%\git.log. - Restart all Git clients including consoles, Visual Studio, etc.
- Reproduce the issue.
- Collect the logs from
%UserProfile%\git.log.
Once you have the logs captured, please share them here. Of course, as always, please redact any personal, secret, or personally identifiable information before sharing on the Internet.
Of time the logs will get large. To avoid this, you can disable trace logging by...
- Open Command Prompt
- Run
setx GIT_TRACE "". - Run
setx GCM_TRACE "". - Restart all Git clients including consoles, Visual Studio, etc.
@whoisj Here's the log with my username redacted.
12:14:58.242625 git.c:340 trace: built-in: git 'remote' '--verbose'
12:15:38.289999 git.c:340 trace: built-in: git 'for-each-ref' '--format='\''[%(refname)][%(objecttype)][%(objectname)][%(upstream)][%(push)][%(HEAD)]'\''' 'refs/heads/' 'refs/remotes/'
12:15:38.305624 git.c:340 trace: built-in: git 'rev-parse' '--git-dir' '--git-common-dir' '--is-bare-repository' '--git-path' 'index' '--git-path' 'objects/' '--git-path' 'hooks/' '--git-path' 'info/' '--git-path' 'logs/' '--git-path' 'HEAD' '--git-path' 'description' '--git-path' 'refs/' '--show-toplevel' '--shared-index-path'
12:15:38.377518 git.c:340 trace: built-in: git 'status' '--porcelain=v2' '--branch' '--no-lock-index' '--untracked-files=all' '--show-ignored-directory' '--ignore-submodules=none' '--ignored'
12:15:38.377518 git.c:340 trace: built-in: git 'cat-file' '--batch=[%(objectname)][%(objecttype)][%(objectsize)]'
12:15:38.621994 git.c:340 trace: built-in: git 'config' '--show-origin' '--list' '-z'
12:15:39.044405 git.c:340 trace: built-in: git 'for-each-ref' '--format='\''[%(refname)][%(objecttype)][%(objectname)][%(upstream)][%(push)][%(HEAD)]'\''' 'refs/heads/' 'refs/remotes/'
12:15:39.129093 git.c:340 trace: built-in: git 'rev-list' '--stdin' '--use-bitmap-index' '--header' 'refs/heads/master' '--'
12:15:41.651766 git.c:340 trace: built-in: git 'remote' '--verbose'
12:15:41.765676 git.c:340 trace: built-in: git 'config' '--show-origin' '--list' '-z'
12:15:54.414072 git.c:340 trace: built-in: git 'diff-tree' '--no-ext-diff' '--full-index' '--abbrev=40' '-m' '-r' '--name-status' '--no-renames' '--diff-filter=ACDTMBRXU' 'HEAD' 'refs/heads/develop'
12:15:54.521367 git.c:340 trace: built-in: git 'for-each-ref' '--format='\''[%(refname)][%(objecttype)][%(objectname)][%(upstream)][%(push)][%(HEAD)]'\''' 'refs/heads/' 'refs/remotes/'
12:15:54.594397 git.c:340 trace: built-in: git 'checkout' '--progress' 'develop'
12:15:54.690668 git.c:340 trace: built-in: git 'for-each-ref' '--format='\''[%(refname)][%(objecttype)][%(objectname)][%(upstream)][%(push)][%(HEAD)]'\''' 'refs/heads/' 'refs/remotes/'
12:15:54.775164 git.c:340 trace: built-in: git 'cat-file' '--batch=[%(objectname)][%(objecttype)][%(objectsize)]'
12:15:54.806416 git.c:340 trace: built-in: git 'status' '--porcelain=v2' '--branch' '--no-lock-index' '--untracked-files=all' '--show-ignored-directory' '--ignore-submodules=none' '--ignored'
12:15:54.859820 git.c:340 trace: built-in: git 'rev-list' '--use-bitmap-index' '--header' 'refs/heads/develop..refs/remotes/origin/develop' '--'
12:15:54.928251 git.c:340 trace: built-in: git 'rev-list' '--use-bitmap-index' '--header' 'refs/remotes/origin/develop..refs/heads/develop' '--'
12:15:54.944258 git.c:340 trace: built-in: git 'remote' '--verbose'
12:15:55.017266 git.c:340 trace: built-in: git 'config' '--show-origin' '--list' '-z'
12:15:55.938843 git.c:340 trace: built-in: git 'for-each-ref' '--format='\''[%(refname)][%(objecttype)][%(objectname)][%(upstream)][%(push)][%(HEAD)]'\''' 'refs/heads/' 'refs/remotes/'
12:15:56.006966 git.c:340 trace: built-in: git 'cat-file' '--batch=[%(objectname)][%(objecttype)][%(objectsize)]'
12:15:58.209999 git.c:340 trace: built-in: git 'for-each-ref' '--format='\''[%(refname)][%(objecttype)][%(objectname)][%(upstream)][%(push)][%(HEAD)]'\''' 'refs/heads/' 'refs/remotes/'
12:15:58.290077 git.c:340 trace: built-in: git 'remote' '--verbose'
12:15:58.347556 git.c:340 trace: built-in: git 'pull' '--verbose' '--progress' '--no-edit' '--no-stat' '--recurse-submodules=no' 'origin'
12:15:58.347556 run-command.c:626 trace: run_command: 'fetch' '--update-head-ok' '-v' '--progress' '--recurse-submodules=no' 'origin'
12:15:58.378813 git.c:340 trace: built-in: git 'fetch' '--update-head-ok' '-v' '--progress' '--recurse-submodules=no' 'origin'
12:15:58.394442 run-command.c:626 trace: run_command: 'remote-https' 'origin' 'https://[email protected]/prysm/synthesis.http.git'
12:15:58.425693 git.c:572 trace: exec: 'git-remote-https' 'origin' 'https://[email protected]/prysm/synthesis.http.git'
12:15:58.425693 run-command.c:626 trace: run_command: 'git-remote-https' 'origin' 'https://[email protected]/prysm/synthesis.http.git'
12:15:58.925993 run-command.c:626 trace: run_command: 'git credential-manager get'
12:15:59.079572 git.c:572 trace: exec: 'git-credential-manager' 'get'
12:15:59.079572 run-command.c:626 trace: run_command: 'git-credential-manager' 'get'
12:15:59.196910 ...\Common.cs:665 trace: [Main] git-credential-manager (v1.16.2) 'get'
12:15:59.275959 ...\Git\Where.cs:343 trace: [FindGitInstallations] found 1 Git installation(s).
12:15:59.282960 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 45 entries.
12:15:59.283960 ...\Common.cs:393 trace: [LoadOperationArguments] GCM_HTTP_USER_AGENT = 'git-credential-manager (Microsoft Windows NT 10.0.16299.0; Win32NT x64) CLR/4.0.30319 VS15/15.0.0'.
12:15:59.286960 ...\Common.cs:445 trace: [LoadOperationArguments] interactive = 'Auto'.
12:15:59.286960 ...\Common.cs:463 trace: [LoadOperationArguments] validate = 'True'.
12:15:59.287960 ...\Common.cs:479 trace: [LoadOperationArguments] modalPrompt = 'True'.
12:15:59.318330 ...\Common.cs:84 trace: [CreateAuthentication] detecting authority type for 'https://[email protected]/'.
12:15:59.329454 ...uthentication.cs:319 trace: [GetAuthentication] authentication for Bitbucket created
12:15:59.329454 ...\Common.cs:173 trace: [CreateAuthentication] authority for 'https://[email protected]/' is Bitbucket
12:15:59.329454 ...seSecureStore.cs:195 trace: [ReadCredentials] credentials for 'git:https://[email protected]' read from store.
12:15:59.329454 ...uthentication.cs:180 trace: [GetCredentials] successfully retrieved stored credentials, updating credential cache
12:15:59.348655 ...\Authority.cs:214 trace: [ValidateCredentials] authentication type = 'Credential'.
12:16:00.294748 ...\Git\Trace.cs:139 trace: [WriteException] ! error: 'An error occurred while sending the request.'.
12:16:00.294748 ...\Git\Trace.cs:143 trace: [WriteException] > 'The underlying connection was closed: The connection was closed unexpectedly.'.
12:16:00.328546 ...\Common.cs:630 trace: [LogEvent] System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The underlying connection was closed: The connection was closed unexpectedly.
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Alm.Authentication.Network.<HttpGetAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Atlassian.Bitbucket.Authentication.Rest.RestClient.<TryGetUser>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Atlassian.Bitbucket.Authentication.Authority.<ValidateCredentials>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Atlassian.Bitbucket.Authentication.Authority.<ValidateCredentials>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Atlassian.Bitbucket.Authentication.Authentication.<ValidateCredentials>d__33.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Alm.Cli.CommonFunctions.<QueryCredentials>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Alm.Cli.Program.<>c__DisplayClass23_1.<<Get>b__0>d.MoveNext()
12:16:00.328546 ...\Program.cs:578 trace: [Run] fatal: HttpRequestException encountered.
An error occurred while sending the request.
12:16:00.349690 run-command.c:626 trace: run_command: '/C/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer/Git/mingw32/libexec/git-core/git-askpass.exe' 'Password for '\''https://[email protected]'\'': '
Running into this issue as well with the new update to VS :(
Same problem here... Trying to pull/push bitbucket updates on Visual Studio Version 15.7.6.
I'm having the same problem using bitbucket and Visual Studio Version 15.7.6.
Same problem here. I had to pull/push commis out VS. My VS version 15.7.6 too. T.T
Can't pull and push either. Before today it were working fine, now when I try to pull or push I get this error message: No such file or directory could not read Username for 'https://bitbucket.org': terminal prompts disabled