Open mohan023 opened 4 years ago
Note: Adding this comment here to provide more information (as already added into #2509 )
Hi Team,
Even I am facing this issue with GitHub extension with Visual Studio 2019. I have tried the above workarounds (uninstalling/reverting to previous version etc.) but no luck.
I am able to sign-in successfully to GitHub on my browser but through extension, when I click on 'Sign in with your browser' option, it opens the browser with the below URL and it just keeps loading: https://github.com/login/oauth/authorize?client_id=a200baed193bb2088a6e&scope=user%2Crepo%2Cgist%2Cwrite%3Apublic_key%2Cread%3Aorg%2Cworkflow&state=cd3677b8-bf82-4d2d-80c2-71fb3ed7cb63
Below is the error captured from Github Extension log:
2020-08-15 22:29:05.832 [20420] INFO [58] GitHubPackage Initializing GitHub Extension v2.11.104.25275 in Microsoft Visual Studio 2019 (16.6.30114.105) 2020-08-15 22:29:23.860 [20420] EROR [01] LoginTabViewModel Error logging into '"https://github.com/"' as '' Octokit.AuthorizationException: Requires authentication at Octokit.Connection.HandleErrors(IResponse response) at Octokit.Connection.
d58.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Octokit.Connection. d 571.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at GitHub.Api.LoginManager.<GetUserAndCheckScopes>d__23.MoveNext() in D:\a\VisualStudio\VisualStudio\src\GitHub.Api\LoginManager.cs:line 346 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at GitHub.Api.LoginManager.<ReadUserWithRetry>d__22.MoveNext() in D:\a\VisualStudio\VisualStudio\src\GitHub.Api\LoginManager.cs:line 335 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at GitHub.Api.LoginManager.<LoginViaOAuth>d__14.MoveNext() in D:\a\VisualStudio\VisualStudio\src\GitHub.Api\LoginManager.cs:line 158 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at GitHub.VisualStudio.ConnectionManager.<LogInViaOAuth>d__14.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at GitHub.ViewModels.Dialog.LoginTabViewModel.<LoginToHostViaOAuth>d__56.MoveNext() in D:\a\VisualStudio\VisualStudio\src\GitHub.App\ViewModels\Dialog\LoginTabViewModel.cs:line 173 {"message":"Requires authentication","documentation_url":"https://docs.github.com/rest/reference/users#get-the-authenticated-user"} 2020-08-15 22:31:05.818 [20420] EROR [05] GitHubServiceProvider Error loading GitHub.Services.IConnectionManager System.InvalidOperationException: Due to high risk of deadlock you cannot call GetService from a background thread in an AsyncPackage derived class. You should instead call GetServiceAsync (without calling Result or Wait on the resultant Task object) or switch to the UI thread with the JoinableTaskFactory.SwitchToMainThreadAsync method before calling GetService. at Microsoft.VisualStudio.Shell.AsyncPackage.GetService(Type serviceType) at Microsoft.VisualStudio.Shell.Package.System.IServiceProvider.GetService(Type serviceType) at GitHub.VisualStudio.GitHubServiceProvider.TryGetService(Type serviceType) 2020-08-15 22:34:32.192 [20420] EROR [01] LoginTabViewModel Error logging into '"https://github.com/"' as '' Octokit.AuthorizationException: Requires authentication at Octokit.Connection.HandleErrors(IResponse response) at Octokit.Connection.<RunRequest>d__58.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Octokit.Connection.<Run>d__57
1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at GitHub.Api.LoginManager.d23.MoveNext() in D:\a\VisualStudio\VisualStudio\src\GitHub.Api\LoginManager.cs:line 346 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at GitHub.Api.LoginManager. d 22.MoveNext() in D:\a\VisualStudio\VisualStudio\src\GitHub.Api\LoginManager.cs:line 335 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at GitHub.Api.LoginManager.d14.MoveNext() in D:\a\VisualStudio\VisualStudio\src\GitHub.Api\LoginManager.cs:line 158 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at GitHub.VisualStudio.ConnectionManager. d 14.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at GitHub.ViewModels.Dialog.LoginTabViewModel.d__56.MoveNext() in D:\a\VisualStudio\VisualStudio\src\GitHub.App\ViewModels\Dialog\LoginTabViewModel.cs:line 173 {"message":"Requires authentication","documentation_url":"https://docs.github.com/rest/reference/users#get-the-authenticated-user"}
I have the same problem,
Logs here extension.log
I solved the problem by connecting in Github : Profile/Settings/Developer settings/Personal access tokens Then revoke all from token access list. Direct url
@mohan023 @techduggu,
@cyounes was able to resolve this by opening Visual Studio as Administrator before logging in, see https://github.com/github/VisualStudio/issues/2550#issuecomment-703280956
Any chance you could give this a try?
I'm still facing this issue. Tried most of the suggestions mentioned here.
@mohan023, I'm sorry this didn't fix it. Thanks for trying!
Hi @mohan023 (and @techduggu),
I think the issue you've been seeing might be this #2560 (reported by @osmanager). I've opened a PR that I hope will resolve the problem here #2562.
Could you try installing the artifact from this build: https://github.com/github/VisualStudio/pull/2562/checks?check_run_id=1309274757
You can find it here: https://github.com/github/VisualStudio/suites/1400504505/artifacts/23266202
After opening and installing the VSIX, can you let me know if it works any better? Any help confirming this fix would be much appreciated!
@jcansdale I have the same issue as Mohan023 and techduggu. I tried using the link you provided, https://github.com/github/VisualStudio/suites/1400504505/artifacts/23266202 but I receive a 404 error.
Hi @BHinrichs1966,
Could you try installing the artifact from this link? https://github.com/github/VisualStudio/runs/1343191255?check_suite_focus=true
I downloaded the new extension. When I attempt to install it, it fails.
[cid:image001.png@01D6B1C7.46C8C7A0]
I am attaching the .log
I am able to install the “production” version of this extension using the VS extension manager. But, not able to install this local copy. My company does have restrictions on our machines. I am not an administrator on my own machine. Could that be causing this to fail?
Brad Hinrichs Data Architect, Advisory Bank Solutions Office: 402-423-2682 x. 3966
Fiserv Register Today! | Forum 2020 Virtual Experiencehttps://www.fiserv.com/en/forum-2020.html?utm_medium=link&utm_campaign=forum2020&utm_source=fiservsignature&utm_content=text_save_the_date Fiservhttps://www.fiserv.com/index.aspx | Join Our Teamhttps://www.careers.fiserv.com/?utm_source=outlook&utm_medium=email&utm_campaign=signature | Twitterhttps://twitter.com/fiserv | LinkedInhttps://www.linkedin.com/company/fiserv/ | Facebookhttps://www.facebook.com/Fiserv/ FORTUNE Magazine World's Most Admired Companies® 2014 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 © 2019 Fiserv, Inc. or its affiliates. Fiserv is a registered trademark of Fiserv, Inc. Privacy Policyhttp://fiserv.com/about/privacypolicy.aspx
From: Jamie Cansdale [mailto:notifications@github.com] Sent: Tuesday, November 3, 2020 8:40 AM To: github/VisualStudio VisualStudio@noreply.github.com Cc: Hinrichs, Brad (Lincoln) Brad.Hinrichs@fiserv.com; Mention mention@noreply.github.com Subject: Re: [github/VisualStudio] unable to connect to GitHub using visual studio 2019 (#2527)
⚠EXTERNAL MESSAGE – Think Before You Click
Could you try installing the artifact from this link? https://github.com/github/VisualStudio/runs/1343191255?check_suite_focus=truehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_github_VisualStudio_runs_1343191255-3Fcheck-5Fsuite-5Ffocus-3Dtrue&d=DwMCaQ&c=rE3mhBYFJfJGqQ7WI0-DPw&r=RC4v873OWPHaybHpbiRBtSxju4MLORmRToKb-DY5204&m=hTuSl72717zcbsE6wHcEgeS2xBDR3ZsIzfy2Hghsi40&s=qehlUdiX15PPrH9esDjh3NnitVUK2U_aXoL46d5521U&e=
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_github_VisualStudio_issues_2527-23issuecomment-2D721155993&d=DwMCaQ&c=rE3mhBYFJfJGqQ7WI0-DPw&r=RC4v873OWPHaybHpbiRBtSxju4MLORmRToKb-DY5204&m=hTuSl72717zcbsE6wHcEgeS2xBDR3ZsIzfy2Hghsi40&s=wdwrD0cNvG9zAJ6-68Mr_Bvo3CnmNBIit1rh8LfcT6k&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ARQXTOGN7GQBOS4HCPPSX7LSOAI3ZANCNFSM4ONOEW5Q&d=DwMCaQ&c=rE3mhBYFJfJGqQ7WI0-DPw&r=RC4v873OWPHaybHpbiRBtSxju4MLORmRToKb-DY5204&m=hTuSl72717zcbsE6wHcEgeS2xBDR3ZsIzfy2Hghsi40&s=4emW2gJhHoTRk9lSNap24OA4dSzPvki6sknZEMR5RC0&e=.
@BHinrichs1966,
I am able to install the “production” version of this extension using the VS extension manager. But, not able to install this local copy. My company does have restrictions on our machines. I am not an administrator on my own machine. Could that be causing this to fail?
Yes, that could be causing this to fail. I'll let you know when this fix has been confirmed and a new version has been pushed to production!
Do we have anyone who is not facing this issue anymore?
@mohan023 I'm seeing this again :/
@mohan023, @ttaylor29,
Any chance you could try the VSIX artifact from this build? https://github.com/github/VisualStudio/pull/2562/checks?check_run_id=1343191255
@jcansdale Will this work if I just want normal GitHub and not the GitHub Enterprise Server?
@ttaylor29,
If there is an HTTP proxy between you and GitHub, it could make a difference. I'm interested to find out!
@jcansdale I'll try this in a bit at lunch if I can!
@jcansdale How do I implement this?
Any chance you could try the VSIX artifact from this build? https://github.com/github/VisualStudio/pull/2562/checks?check_run_id=1343191255
FYI, I just tried it again with Chrome and it fails ; FireFox still works on my work laptop.
@jcansdale How do I implement this?
Any chance you could try the VSIX artifact from this build? https://github.com/github/VisualStudio/pull/2562/checks?check_run_id=1343191255
FYI, I just tried it again with Chrome and it fails ; FireFox still works on my work laptop.
Never mind, I found the artifact folder with the GitHub.VisualStudio.vsix
@jcansdale It still failed :-(
Then this shows up:
@jcansdale @mohan023
I might have found it.
put this into Chrome address bar:
chrome://net-internals/#hsts
Then go to the bottom and delete localhost from the Delete domain security policies
Then try to sign into GitHub via VS2019 and it worked!!!
Chrome and Edge are chromium underneath the hood, so that is why it is happening on both!
I think my work puts these settings on from the group policy. I have to do this with using IIS local to run my web application sometimes.
@ttaylor29 I'm glad you figured it out!
I wonder if it treats localhost
the same as 127.0.0.1
? 🤔
chrome://net-internals/#hsts
This method work for me. i have no problem with webapp then using localhost too. Maybe beacause adress is set for VS.
What worked for me was deleting all my cookies and browsing history (From Microsoft Edge Browser)
@jcansdale @mohan023
I might have found it.
put this into Chrome address bar:
chrome://net-internals/#hsts
This works for me. Thanks
Below is what I got in logs.
Octokit.AuthorizationException: Must authenticate to access this API. at Octokit.Connection.HandleErrors(IResponse response) at Octokit.Connection.d58.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Octokit.Connection.d 57d18.MoveNext() in D:\a\VisualStudio\VisualStudio\src\GitHub.Api\LoginManager.cs:line 220
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at GitHub.Api.LoginManager.d 13.MoveNext() in D:\a\VisualStudio\VisualStudio\src\GitHub.Api\LoginManager.cs:line 102
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at GitHub.Api.LoginManager.d13.MoveNext() in D:\a\VisualStudio\VisualStudio\src\GitHub.Api\LoginManager.cs:line 125
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at GitHub.VisualStudio.ConnectionManager.d 13.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at GitHub.ViewModels.Dialog.LoginTabViewModel.d__55.MoveNext() in D:\a\VisualStudio\VisualStudio\src\GitHub.App\ViewModels\Dialog\LoginTabViewModel.cs:line 159
{"message":"Must authenticate to access this API.","documentation_url":"https://developer.github.com/enterprise/2.19/v3"}
1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Octokit.ApiConnection.<Put>d__26
1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at GitHub.Api.LoginManager.