Can't push git, visual studio. Git failed with a fatal error. fatal: HttpRequestException encountered

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Can't push git, visual studio. Git failed with a fatal error. fatal: HttpRequestException encountered



Here is my error on visual studio.
I can't figure out if there is a config to fix this.
Additionally I am restricted from installing git command line tools.


Error encountered while pushing to the remote repository: Git failed with a fatal error.
fatal: HttpRequestException encountered.
An error occurred while sending the request.
error: cannot spawn askpass: No such file or directory
fatal: could not read Username for 'https://github.com': terminal prompts disabled





Possible duplicate of Git failed with a > fatal error. could not read Username for
– phd
Feb 23 at 22:16





This is not a duplicate of that issue. Daedalon is correct; GitHub's removal of pre-TLS 1.2 have caused this issue.
– Edward Thomson
Feb 25 at 1:09





I'd recommend changing the accepted answer to Lachezar's answer, for reasons mentioned in Suamere's comment on the currently(3/2/18) accepted answer.
– BMB
Mar 2 at 18:15




7 Answers
7



Cause: GitHub updated their security requirements on the server side. They no longer support TLS 1.0 and 1.1, only 1.2. Older Git Credential Manager for Windows versions used 1.0.



Solution: Update Git for Windows. Version 2.14.3 and newer include an up-to-date Git Credential Manager for Windows.



Alternatively you can update only the Git Credential Manager for Windows itself. It supports TLS 1.2 from version 1.14.0 onwards.





This is great info, but since you should update VS anyway, Lachezar's answer worked better for me. Updaing VS did indeed solve all of the issues you talked about, without having to finagle with my system in manual ways.
– Suamere
Feb 25 at 18:01





VS Update did it for me
– Ozan BAYRAM
Mar 1 at 14:15





@daedalon I have installed VS enterprise 2017 today which is showing up to date. But still while trying to clone a VSTS git repo, I am getting "Git fatal error. HttpRequestException. Cannot spawn..". Can you please give suggestion for this?
– Rohit Garg
Mar 13 at 16:20






Hi @RohitGarg, sounds like that could be a different error. If your error message is identical to the one in the original question, double-check that you have the latest version of VS. If you do, you may consider updating Git for Windows or Git Credential Manager separately.
– Daedalon
Mar 16 at 19:34





For me, it got fixed by copying the two dll files I.e. libeay32.dll and ssleay32.dll from <VS_INSTALL>Common7IDECommonExtensionsMicrosoftTeamFoundationTeam ExplorerGitmingw32bin" folder to the "<VS_INSTALL>Common7IDECommonExtensionsMicrosoftTeamFoundationTeam ExplorerGitmingw32libexecgit-core" folder
– Rohit Garg
Mar 19 at 16:07



Simply update your Visual Studio to the latest version and this should be fixed. Worked for me.





Thank you Lachezar. Specifically, VS 2017 version 15.5.7 (release 2/20/18) mentions this fix: "We have updated the Git and the Git Credential Manager components"
– Emilio
Feb 27 at 20:50





Thanks, worked perfectly. This should be the accepted answer.
– BMB
Mar 2 at 18:12





I tried this answer first, but had to update Git for Windows before it worked again.
– pursang
May 31 at 12:00





I have v15.7.6 and still have this issue. And I updated Git for Windows and Credential Manager too. Still same error as OP.
– smoore4
Aug 10 at 14:24





Strange that I only encountered this problem AFTER updating VS2017...
– Nicholas Humphrey
Aug 23 at 20:49



Git Credential Manager for Windows v1.17.1 fixes the issue on BitBucket. Note the one comment:



Bug Fixes:


Fixes a bug related to Bitbucket authentication (thanks to @Foda for contributing the fixes).



https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases



This is because Github disabled TLS v1.0 and v1.1,you can read the notice on Github Engineering, here is the link Weak cryptographic standards removal notice.



From the linked page:



Last year we announced the deprecation of several weak cryptographic standards. Then we provided a status update toward the end of last year outlining some changes we’d made to make the transition easier for clients. We quickly approached the February 1, 2018 cutoff date we mentioned in previous posts and, as a result, pushed back our schedule by one week.



...



Visual Studio ships with specific versions of Git for Windows and the Git Credential Manager for Windows (GCM). Microsoft has updated the latest versions of Visual Studio 2017 to work with TLSv1.2 Git servers. We advise users of Visual Studio to upgrade to the latest release by clicking on the in-product notification flag or by checking for an update directly from the IDE. Microsoft has provided additional guidance on the Visual Studio developer community support forum.





While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
– SiHa
Feb 26 at 12:59



Check if you have proper configuration. It might be possible if all are okay, there is a wrong email.
Inside Team explorer check Global Settings for email.





Git failed with a fatal error. could not read Username for 'test.visualstudio.com';: terminal prompts disabled
– Asif Hameed
Jun 8 at 9:21



In my case, updating git and copying the bin directory cannot fix the error. My solution is checking your git config.
First, open git bash.
Second, check git config. git config -l
The http.proxy and https.proxy would make you cannot update the project successfully. And if you use vpn, and make the 1080 port open, that would make the upload not so smoothly.(Only the case that your vpn is slow)


git config -l



in my case the above didnt work since my goggle email address for bitbucket had 2 factor authentication. So i had to create a bitbucket app token and in the origin https url i had to put the token that was generated like so https://username:appToken@bitbucket.org/repo/test.git






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard