X Tutup
The Wayback Machine - https://web.archive.org/web/20201215060019/https://github.com/github/VisualStudio/issues/2527
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to connect to GitHub using visual studio 2019 #2527

Open
mohan023 opened this issue Jul 1, 2020 · 21 comments
Open

unable to connect to GitHub using visual studio 2019 #2527

mohan023 opened this issue Jul 1, 2020 · 21 comments

Comments

@mohan023
Copy link

@mohan023 mohan023 commented Jul 1, 2020

Below is what I got in logs.

Octokit.AuthorizationException: Must authenticate to access this API.
at Octokit.Connection.HandleErrors(IResponse response)
at Octokit.Connection.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.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 Octokit.ApiConnection.<Put>d__261.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.d__18.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.d__13.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"}

image
image

@techduggu
Copy link

@techduggu techduggu commented Aug 15, 2020

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.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.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__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.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.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.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.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"}

@YounesCheikh
Copy link

@YounesCheikh YounesCheikh commented Sep 6, 2020

I have the same problem,

Logs here
extension.log

Solution worked for me 👍

I solved the problem by connecting in Github : Profile/Settings/Developer settings/Personal access tokens
Then revoke all from token access list. Direct url

@jcansdale
Copy link
Collaborator

@jcansdale jcansdale commented Oct 5, 2020

@mohan023 @techduggu,

@cyounes was able to resolve this by opening Visual Studio as Administrator before logging in, see #2550 (comment)

Any chance you could give this a try?

@mohan023
Copy link
Author

@mohan023 mohan023 commented Oct 6, 2020

I'm still facing this issue. Tried most of the suggestions mentioned here.

@jcansdale
Copy link
Collaborator

@jcansdale jcansdale commented Oct 6, 2020

@mohan023, I'm sorry this didn't fix it. Thanks for trying!

@jcansdale
Copy link
Collaborator

@jcansdale jcansdale commented Oct 26, 2020

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!

@BHinrichs1966
Copy link

@BHinrichs1966 BHinrichs1966 commented Oct 26, 2020

@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.

@jcansdale
Copy link
Collaborator

@jcansdale jcansdale commented Nov 3, 2020

Hi @BHinrichs1966,

Could you try installing the artifact from this link?
https://github.com/github/VisualStudio/runs/1343191255?check_suite_focus=true

@BHinrichs1966
Copy link

@BHinrichs1966 BHinrichs1966 commented Nov 3, 2020

@jcansdale
Copy link
Collaborator

@jcansdale jcansdale commented Nov 3, 2020

@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!

@mohan023
Copy link
Author

@mohan023 mohan023 commented Nov 11, 2020

Do we have anyone who is not facing this issue anymore?

@ttaylor29
Copy link

@ttaylor29 ttaylor29 commented Nov 18, 2020

@mohan023 I'm seeing this again :/

@jcansdale
Copy link
Collaborator

@jcansdale jcansdale commented Nov 18, 2020

@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

@ttaylor29
Copy link

@ttaylor29 ttaylor29 commented Nov 18, 2020

@jcansdale Will this work if I just want normal GitHub and not the GitHub Enterprise Server?

@jcansdale
Copy link
Collaborator

@jcansdale jcansdale commented Nov 18, 2020

@ttaylor29,

If there is an HTTP proxy between you and GitHub, it could make a difference. I'm interested to find out!

@ttaylor29
Copy link

@ttaylor29 ttaylor29 commented Nov 18, 2020

@jcansdale I'll try this in a bit at lunch if I can!

@ttaylor29
Copy link

@ttaylor29 ttaylor29 commented Nov 19, 2020

@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.

@ttaylor29
Copy link

@ttaylor29 ttaylor29 commented Nov 19, 2020

@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

@ttaylor29
Copy link

@ttaylor29 ttaylor29 commented Nov 19, 2020

@jcansdale It still failed :-(

  • I go to sign in via this:

image

  • Then I get this to show up

image

Then this shows up:

image

@ttaylor29
Copy link

@ttaylor29 ttaylor29 commented Nov 19, 2020

@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.

image

@jcansdale
Copy link
Collaborator

@jcansdale jcansdale commented Nov 20, 2020

@ttaylor29 I'm glad you figured it out!

I wonder if it treats localhost the same as 127.0.0.1? 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.
X Tutup