vscode-pull-request-github: Error signing in to GitHub Enterprise (cloud-hosted)

  • Extension version:
  • VSCode Version: 1.65.2
  • OS: macOS Monterey 12.3

Steps to Reproduce:

  1. Cloned repository from our company github enterprise account (cloud-hosted) and opened in vscode

  2. Clicked “Sign in with GitHub Enterprise to use GitHub PullRequests and Issues (1)” image

  3. Created and authorized PAT (SSO)

  4. Pasted PAT into prompt image

  5. Received error: Sign in failed: Error: network error image

Notes: Following this wiki entry I tried setting "github-enterprise.uri": "https://github.com/<organization>",.

Without this setting I receive a different error: Sign in failed: Error: [UriError]: Scheme is missing: {scheme: "", authority: "", path: "", query: "", fragment: ""} image

Do I need to configure something differently when working with a GitHub Enterprise repo but cloud-hosted?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 4
  • Comments: 29 (11 by maintainers)

Commits related to this issue

Most upvoted comments

I have a similar issue but no reference to “network error”. I get this image

I have installed the prerelease version (v0.43.2022050511) but still the same result.

+1 Confirming this issue is reproducible.

Version: 1.66.1 (system setup)
Commit: 8dfae7a5cd50421d10cd99cb873990460525a898
Date: 2022-04-06T14:50:12.141Z
Electron: 17.2.0
Chromium: 98.0.4758.109
Node.js: 16.13.0
V8: 9.8.177.11-electron.0
OS: Windows_NT x64 10.0.19044

image

I’m updating the queries setting to indicate that the queries are run against only your open repos, and I’ve opened this feature request to track allowing queries to do more than that: https://github.com/microsoft/vscode-pull-request-github/issues/4228

I don’t think anyone else in this thread is having GitHub Enterprise auth troubles, so I’m closing it. If this is incorrect please do comment or open a new issue so I can continue to investigate! The GitHub Enterprise auth path is still new and imperfect since Enterprise servers can be configured differently and it’s very difficult for us to know all the cases to test. Having issues from the community is the only way we have to find out about them.

Great! Then the fix for https://github.com/microsoft/vscode-pull-request-github/issues/4056 will fix it for others who unknowingly end up in the same state.

Sorry for taking so long to respond here.

@jordanenglish and @jacob-vincent-gmi thank you for trying again and for all the details. Since you sign in with your personal GitHub username we shouldn’t be taking you through the GitHub Enterprise Authentication path at all. It should still use plain old GitHub Authentication for this. I’m wondering if this is a duplicate of the root cause of https://github.com/microsoft/vscode-pull-request-github/issues/4056, where it’s obviously github.com but the check is missing. Do you have the setting github-enterprise.uri? That can cause this bug. There is a fix going in this week that will fix it if that’s the case.

Hi @alexr00

A few questions for folks in this thread:

  • Please try out the latest VS Code insiders with the latest pre-release extension. You don’t need to use a PAT there. Do you still get the error (or a new error)?

I am using GitHub Pull Requests and Issues extension v0.53.2022101809

  • Is the url of your cloud hosted GitHub Enterprise instance a github.com url?

yes: github.com/<company>

  • Do you use your github.com username to sign in or the account managed by your enterprise organization to sign in?

My personal GitHub username that has access to the enterprise organization.


I get thrown into a number of prompts and just keep going in a loop.

image image image image


Here is a log dump of my GitHub Enterprise Authentication from these attempts:

[2022-10-27 10:52:47.663] [GitHub Enterprise Authentication] [info] Reading sessions from keychain...
[2022-10-27 10:52:48.328] [GitHub Enterprise Authentication] [info] Getting sessions for read:user,repo,user:email,workflow...
[2022-10-27 10:52:48.328] [GitHub Enterprise Authentication] [info] Got 0 sessions for read:user,repo,user:email,workflow...
[2022-10-27 10:52:48.338] [GitHub Enterprise Authentication] [info] Getting sessions for read:user,repo,user:email...
[2022-10-27 10:52:48.338] [GitHub Enterprise Authentication] [info] Got 0 sessions for read:user,repo,user:email...
[2022-10-27 10:52:49.084] [GitHub Enterprise Authentication] [info] Getting sessions for read:user,repo,user:email,workflow...
[2022-10-27 10:52:49.084] [GitHub Enterprise Authentication] [info] Got 0 sessions for read:user,repo,user:email,workflow...
[2022-10-27 10:52:49.092] [GitHub Enterprise Authentication] [info] Getting sessions for read:user,repo,user:email...
[2022-10-27 10:52:49.092] [GitHub Enterprise Authentication] [info] Got 0 sessions for read:user,repo,user:email...
[2022-10-27 10:52:58.288] [GitHub Enterprise Authentication] [info] Getting sessions for read:user,repo,user:email,workflow...
[2022-10-27 10:52:58.289] [GitHub Enterprise Authentication] [info] Got 0 sessions for read:user,repo,user:email,workflow...
[2022-10-27 10:52:58.297] [GitHub Enterprise Authentication] [info] Getting sessions for read:user,repo,user:email...
[2022-10-27 10:52:58.297] [GitHub Enterprise Authentication] [info] Got 0 sessions for read:user,repo,user:email...
[2022-10-27 10:52:58.305] [GitHub Enterprise Authentication] [info] Getting sessions for read:user,repo,user:email,workflow...
[2022-10-27 10:52:58.305] [GitHub Enterprise Authentication] [info] Got 0 sessions for read:user,repo,user:email,workflow...
[2022-10-27 10:53:00.998] [GitHub Enterprise Authentication] [info] Logging in for the following scopes: read:user repo user:email workflow
[2022-10-27 10:53:01.005] [GitHub Enterprise Authentication] [info] Trying without local server... (read:user repo user:email workflow)
[2022-10-27 10:53:08.638] [GitHub Enterprise Authentication] [info] Exchanging code for token...
[2022-10-27 10:53:09.447] [GitHub Enterprise Authentication] [error] GitHubTokenExchangeError: incorrect_client_credentials: The client_id and/or client_secret passed are incorrect. (https://docs.github.com/apps/managing-oauth-apps/troubleshooting-oauth-app-access-token-request-errors/#incorrect-client-credentials)
	at v.exchangeCodeForToken (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/github-authentication/dist/extension.js:1:716196)
	at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
	at async /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/github-authentication/dist/extension.js:1:711778
[2022-10-27 10:53:19.420] [GitHub Enterprise Authentication] [info] Trying with local server... (read:user repo user:email workflow)
[2022-10-27 10:53:26.837] [GitHub Enterprise Authentication] [info] Exchanging code for token...
[2022-10-27 10:53:27.378] [GitHub Enterprise Authentication] [error] GitHubTokenExchangeError: incorrect_client_credentials: The client_id and/or client_secret passed are incorrect. (https://docs.github.com/apps/managing-oauth-apps/troubleshooting-oauth-app-access-token-request-errors/#incorrect-client-credentials)
	at v.exchangeCodeForToken (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/github-authentication/dist/extension.js:1:716196)
	at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
	at async /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/github-authentication/dist/extension.js:1:712939
[2022-10-27 10:53:32.760] [GitHub Enterprise Authentication] [error] Error: Cancelled
	at n (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/github-authentication/dist/extension.js:1:710187)
	at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
	at async v.login (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/github-authentication/dist/extension.js:1:710725)
	at async t.GitHubAuthenticationProvider.createSession (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/github-authentication/dist/extension.js:1:706286)
[2022-10-27 10:53:37.709] [GitHub Enterprise Authentication] [info] Getting sessions for read:user,repo,user:email,workflow...
[2022-10-27 10:53:37.709] [GitHub Enterprise Authentication] [info] Got 0 sessions for read:user,repo,user:email,workflow...
[2022-10-27 10:53:37.717] [GitHub Enterprise Authentication] [info] Getting sessions for read:user,repo,user:email...
[2022-10-27 10:53:37.717] [GitHub Enterprise Authentication] [info] Got 0 sessions for read:user,repo,user:email...
[2022-10-27 10:53:37.725] [GitHub Enterprise Authentication] [info] Getting sessions for read:user,repo,user:email,workflow...
[2022-10-27 10:53:37.725] [GitHub Enterprise Authentication] [info] Got 0 sessions for read:user,repo,user:email,workflow...
[2022-10-27 10:53:39.731] [GitHub Enterprise Authentication] [info] Logging in for the following scopes: read:user repo user:email workflow
[2022-10-27 10:53:39.733] [GitHub Enterprise Authentication] [info] Trying without local server... (read:user repo user:email workflow)
[2022-10-27 10:53:42.607] [GitHub Enterprise Authentication] [info] Exchanging code for token...
[2022-10-27 10:53:43.302] [GitHub Enterprise Authentication] [error] GitHubTokenExchangeError: incorrect_client_credentials: The client_id and/or client_secret passed are incorrect. (https://docs.github.com/apps/managing-oauth-apps/troubleshooting-oauth-app-access-token-request-errors/#incorrect-client-credentials)
	at v.exchangeCodeForToken (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/github-authentication/dist/extension.js:1:716196)
	at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
	at async /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/github-authentication/dist/extension.js:1:711778
[2022-10-27 10:54:19.221] [GitHub Enterprise Authentication] [info] Getting sessions for all scopes...
[2022-10-27 10:54:19.222] [GitHub Enterprise Authentication] [info] Got 0 sessions for ...
[2022-10-27 10:54:22.452] [GitHub Enterprise Authentication] [info] Logging in for the following scopes: read:user repo user:email
[2022-10-27 10:54:22.454] [GitHub Enterprise Authentication] [info] Trying without local server... (read:user repo user:email)
[2022-10-27 10:54:25.397] [GitHub Enterprise Authentication] [info] Exchanging code for token...
[2022-10-27 10:54:26.147] [GitHub Enterprise Authentication] [error] GitHubTokenExchangeError: incorrect_client_credentials: The client_id and/or client_secret passed are incorrect. (https://docs.github.com/apps/managing-oauth-apps/troubleshooting-oauth-app-access-token-request-errors/#incorrect-client-credentials)
	at v.exchangeCodeForToken (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/github-authentication/dist/extension.js:1:716196)
	at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
	at async /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/github-authentication/dist/extension.js:1:711778
[2022-10-27 10:54:26.151] [GitHub Enterprise Authentication] [error] Error: Cancelled
	at n (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/github-authentication/dist/extension.js:1:710187)
	at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
	at async v.login (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/github-authentication/dist/extension.js:1:710571)
	at async t.GitHubAuthenticationProvider.createSession (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/github-authentication/dist/extension.js:1:706286)
[2022-10-27 10:54:26.153] [GitHub Enterprise Authentication] [error] Error: Cancelled
	at n (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/github-authentication/dist/extension.js:1:710187)
	at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
	at async v.login (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/github-authentication/dist/extension.js:1:710571)
	at async t.GitHubAuthenticationProvider.createSession (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/github-authentication/dist/extension.js:1:706286)
[2022-10-27 10:54:26.156] [GitHub Enterprise Authentication] [error] Error: Cancelled
	at n (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/github-authentication/dist/extension.js:1:710187)
	at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
	at async v.login (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/github-authentication/dist/extension.js:1:710725)
	at async t.GitHubAuthenticationProvider.createSession (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/github-authentication/dist/extension.js:1:706286)
[2022-10-27 10:54:28.007] [GitHub Enterprise Authentication] [info] Trying device code flow... (read:user repo user:email)
[2022-10-27 10:54:41.093] [GitHub Enterprise Authentication] [info] Getting user info...
[2022-10-27 10:54:41.202] [GitHub Enterprise Authentication] [error] Getting account info failed: Not Found
[2022-10-27 10:54:41.203] [GitHub Enterprise Authentication] [error] Error: Not Found
	at v.getUserInfo (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/github-authentication/dist/extension.js:1:716940)
	at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
	at async t.GitHubAuthenticationProvider.tokenToSession (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/github-authentication/dist/extension.js:1:706957)
	at async t.GitHubAuthenticationProvider.createSession (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/github-authentication/dist/extension.js:1:706322)

+1 I confirm having the same issue with both VS Code and VS code Insider and also in both the Pre-Release and Release versions of GitHub PR extension.