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

@grokys and everyone else, we (Microsoft) have worked closely with Atlassian to resolve the Bitbucket authentication issue. I'd like to take a moment and thank the developers of Atlassian for the scramble they did to resolve the issue. They could have left everything broken longer, but instead took the high road, did the right thing, and fixed a bug that was negatively impacting people. I think that deserves a smile 😁.

I personally (with the blessing of our gate keepers) have pushed the fix into Visual Studio, and an update will arriving as soon as the release gears can complete their turning. I, personally, do not have much insight into the timing of VS update releases, but I know we're targeting 15.8 and 15.9 (still in preview) with the fix. I do not know the exact timing but I do not think it'll be very long.

I do apologize for missing the 15.8.1 release train. The fix just wasn't ready by the time the train had "left the station" and I still had to complete the steps of pulling the fixes into VS, and validating them (not just to fix Bitbucket, but also to ensure they did not break anything else 😲 - they don't 🙂).

So the best I can do right now is say "hold tight" the fix is incoming - promise!

Oh, and I am very sorry that we let this issue slip past. We did not have robust validation around Bitbucket authentication previously. We now have better validation, and will continue to improve all of our testing over time. Again, very sorry and the fix exists, it is on its way, and should be available soon (for some definition of soon).

whoisj avatar Aug 22 '18 04:08 whoisj

The latest VS update (15.8) broke it again. Still broken in 15.8.1

Yup, I knew that was going to happen - sorry. When VS updates itself it also fixes itself. Which means if you've replaced a file in the Visual Studio installation folder and then run update or repair, your replaced file will be replaced with the version the IDE is expecting to be there. 99.99% of the time you really want this feature and it has saved you from heartache over and over, without you even realizing it. In this one, very particular case, it undid the homebrew fix.

The good news is, a soon update to VS should include the official fix.

whoisj avatar Aug 22 '18 04:08 whoisj

disclaimer: slightly off topic.

Since last night, we start seeing the same issue on VSTS: fatal: could not read Username for 'https://bitbucket.org': terminal prompts disabled

This started after the fix for the Hosted Agent Issues in West Europe (not sure if this is related).

Could you provide some insight on what we can do in VSTS to work around this issue,?

Thanks!

koenj avatar Aug 23 '18 06:08 koenj

Until VS is patched, this suggestion is the only one I know for sure that will help. This is because we increased the HTTP_TIMEOUT significantly as part of the work-around for Bitbucket before we understood the root cause. The time change stuck because it would help in other areas.

whoisj avatar Aug 23 '18 14:08 whoisj

Thanks for the input;

I opened a support request with Microsoft for the VSTS bug; they have released a patch to VSTS in the meantime, fixing my issue. So on VSTS, everything is working fine again.

ghost avatar Aug 23 '18 18:08 ghost

Updated to version VS 15.8.2, still facing the same issue. Error encountered while fetching: 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/professional/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:xxxx.com': terminal prompts disabled

PrasanthMahendrakar avatar Aug 29 '18 06:08 PrasanthMahendrakar

I'm now able to push to bitbucket with 15.8.2

JoeHz avatar Aug 29 '18 07:08 JoeHz

15.8.2 fixed it for me. Thanks!

JedatKinports avatar Aug 31 '18 08:08 JedatKinports

i was also struggeling with it . Updated VS to 15.8.9 and he issue was fixed .

wiswis15 avatar Nov 03 '18 07:11 wiswis15

I updated to VS 15.9.3 and the problem returned!!!

I discovered that simply grabbing the AzureDevOps.Authentication.dll assembly from the Git Credential Manager for Windows v1.18.2 zip file and dropping it into the C:\Program Files (x86)\Microsoft Visual Studio\2017\<<<VSEdition>>>\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\libexec\git-core folder allowed me to clone a Dev.Azure.com repo.

HTH.

Sam.

samconn avatar Dec 03 '18 21:12 samconn

Same for me. I'm not sure if 15.9.3 broke it, but it was working for me in earlier versions of VS.

Grauenwolf avatar Dec 10 '18 03:12 Grauenwolf

So i ran into this error and it seems that the bundled Git-Credential-Manager-for-Windows/ in VIsual Studio 2017 is not of the latest release yet. Downloading the latest release and putting it on top of the files in VIsual Studio 2017 worked for me.

1. download the zip file gcmw-v1.17.0.zip from https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases
2. navigate to C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\libexec\ (or wherever your 'missing' git-askpass.exe resides).
3. make a copy of the git-core folder and rename it backup or something like that
4. put the files from the zip file on top of the contents of your new git-core folder and overwrite where prompted

Let me know if this works for you

Edit

might wanna use gcmw-v1.17.1.zip if the 1.17.0 did not work

Didn't work for me. Can you help m in this?

Manika-Kumari avatar Jun 03 '20 06:06 Manika-Kumari

Git failed with a fatal error. HttpRequestException encountered. ��������ʱ����� HttpRequestException encountered. ��������ʱ����� cannot spawn /c/app/visual studio 2019/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

again and again

sgf avatar Oct 09 '20 10:10 sgf

I had the same issue with similar symptoms. My solution was 2 steps

  • Cleaning Github Credentials in Windows Credential Manager
  • SignOut and Remove all accounts in Visual Studio and Re-Sign In with github account

mxfatih avatar Nov 09 '20 12:11 mxfatih