Vscode-pull-request-github: Can't authenticate with GitHub, never provided prompt

Created on 10 Sep 2018  Â·  26Comments  Â·  Source: microsoft/vscode-pull-request-github

  • Extension version: 0.1.1
  • VSCode Version: 1.27.1
  • OS: Windows 10 17134.228

Steps to Reproduce:

  1. Open VS Code
  2. Pop up appears that I need to sign in to use the Pull Requests functionality with a sign in button
  3. Click the Sign In button. Another pop up immediately appears stating that an error occurred signing in to GitHub.com with a "Try Again?" button. Clicking the "Try Again?" button repeats the same flow

Trying to interact with the Pull Requests window creates more pop-ups about not being authenticated. I'm never shown a panel to provide credentials, so I'm not sure how to debug this further.

GitHubEnterprise authentication bug

Most helpful comment

@dwalleck Are there any errors in the Output tab under the GitHub Pull Requests log? Are you behind a firewall, or running a vpn or something that would prevent websocket requests from running correctly?

You can also authenticate manually by going to https://github.com/settings/tokens and generating a token with the read:user, user:email, repo, and write:discussion scopes. Copy the token to the clipboard, open your User Settings in vscode, and add the following entry:

    "github.hosts": [
        {
            "host": "https://github.com",
            "username": "oauth",
            "token": "YOUR TOKEN HERE"
        }
    ]

All 26 comments

@dwalleck can you please try opening Command Palette and search for Sign in to GitHub and see if that can work?

Thanks for the tip. I tried that and I get the same "Error signing in to github.com" pop up as well as a "Not authenticated" pop up.

@dwalleck Are there any errors in the Output tab under the GitHub Pull Requests log? Are you behind a firewall, or running a vpn or something that would prevent websocket requests from running correctly?

You can also authenticate manually by going to https://github.com/settings/tokens and generating a token with the read:user, user:email, repo, and write:discussion scopes. Copy the token to the clipboard, open your User Settings in vscode, and add the following entry:

    "github.hosts": [
        {
            "host": "https://github.com",
            "username": "oauth",
            "token": "YOUR TOKEN HERE"
        }
    ]

Ah good, I knew there had to be output somewhere! Here's what I have in the GitHub Pull Requests log:

Looking for git repository
> git symbolic-ref --short HEAD
> git rev-parse task/ZAM-400
> git rev-parse --symbolic-full-name task/ZAM-400@{u}
> git rev-list --left-right task/ZAM-400...refs/remotes/origin/task/ZAM-400
> git for-each-ref --format %(refname) %(objectname) --sort -committerdate
> git remote --verbose
Git repository found, initializing review manager and pr tree view.
> git config --local --get remote.origin.github-pr-remote
Error signing in to github.com: undefined
Unable to resolve remote: Error: Not authenticated.
> git config --local --get branch.task/ZAM-400.github-pr-owner-number
Review> no matching pull request metadata found for current branch task/ZAM-400
> git branch
> git config --local --get remote.origin.github-pr-remote
> git config --local --get remote.origin.github-pr-remote
> git config --local --get remote.origin.github-pr-remote
> git config --local --get remote.origin.github-pr-remote
> git config --local --get branch.feature/***.github-pr-owner-number
> git config --local --get branch.master.github-pr-owner-number
> git config --local --get branch.task/ZAM-400.github-pr-owner-number
GitHubRepository> Fetching all pull requests failed: Error: Not authenticated.
GitHubRepository> Fetching all pull requests failed: Error: Not authenticated.
GitHubRepository> Fetching all pull requests failed: Error: Not authenticated.
GitHubRepository> Fetching all pull requests failed: Error: Not authenticated.
> git config --local --get branch.task/ZAM-400.github-pr-owner-number
> git config --local --get branch.task/ZAM-400.github-pr-owner-number
Error signing in to github.com: undefined
Error signing in to github.com: undefined
Error signing in to github.com: undefined
Error signing in to github.com: undefined
Error signing in to github.com: undefined
Error signing in to github.com: undefined
> git config --local --get branch.task/ZAM-400.github-pr-owner-number

I'm not currently on a VPN and I don't think my firewall rules have changed beyond the Windows standard defaults (but I could always be wrong about that!) I'll try manually creating a token as you suggested.

Minor update, but manually adding my credentials did work. Thanks! I did double check my firewall settings and just to be safe, I added VS Code to the allow list but I was still seeing the same error.

Weird. This is either the initial connection for the authentication failing, or vscode being unable to open the web browser. I don't think I have enough detailed logging in place to track this down right now unfortunately :-/
Glad to hear it's working now, let us know if it breaks.

I believe I have the same issue, here's my log output:

Looking for git repository
> git symbolic-ref --short HEAD
> git rev-parse master
> git rev-parse --symbolic-full-name master@{u}
> git rev-list --left-right master...refs/remotes/origin/master
> git for-each-ref --format %(refname) %(objectname) --sort -committerdate
> git remote --verbose
Git repository found, initializing review manager and pr tree view.
> git config --local --get remote.origin.github-pr-remote
Error signing in to github.com: undefined

Will try adding the credentials manually next!

No worries, I'll keep tinkering a bit but I'm glad to have it working one way or another. I'm trying to think of any other variables in play here. I am using a system-wide install of VS Code, which I don't think should matter. I'm using the VS LiveShare plugin which also has to spawn a browser, but that seems to work. I installed the plugin from the extensions manager in VS Code even though the blog post said to download the plugin manually. If I try to download the vsix and install manually, I actually get an error saying This extension is not installable on any currently installed products.. Double checked my VS Code version again and I am on the latest (1.27.1) so I'm at a loss there. Here's the log message from the failed install of the plugin:

9/10/2018 2:17:37 PM - Microsoft VSIX Installer
9/10/2018 2:17:37 PM - -------------------------------------------
9/10/2018 2:17:37 PM - vsixinstaller.exe version:
9/10/2018 2:17:37 PM - 15.7.105+ga2c5d563c6
9/10/2018 2:17:37 PM - -------------------------------------------
9/10/2018 2:17:37 PM - Command line parameters:
9/10/2018 2:17:37 PM - C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service\VSIXInstaller.exe,C:\Users\dwall\Downloads\GitHub.vscode-pull-request-github-0.1.1 (1).vsix
9/10/2018 2:17:37 PM - -------------------------------------------
9/10/2018 2:17:37 PM - Microsoft VSIX Installer
9/10/2018 2:17:37 PM - -------------------------------------------
9/10/2018 2:17:38 PM - Initializing Install...
9/10/2018 2:17:38 PM - Extension Details...
9/10/2018 2:17:38 PM -  Identifier         : vscode-pull-request-github
9/10/2018 2:17:38 PM -  Name               : GitHub Pull Requests
9/10/2018 2:17:38 PM -  Author             : GitHub
9/10/2018 2:17:38 PM -  Version            : 0.1.1
9/10/2018 2:17:38 PM -  Description        : Pull Request Provider for GitHub
9/10/2018 2:17:38 PM -  Locale             : en-US
9/10/2018 2:17:38 PM -  MoreInfoURL        : 
9/10/2018 2:17:38 PM -  InstalledByMSI     : False
9/10/2018 2:17:38 PM -  SupportedFrameworkVersionRange : [0.0,2147483647.2147483647]
9/10/2018 2:17:38 PM - 
9/10/2018 2:17:38 PM -  SignatureState     : Unsigned
9/10/2018 2:17:38 PM -  Supported Products : 
9/10/2018 2:17:38 PM -      Microsoft.VisualStudio.Code
9/10/2018 2:17:38 PM -          Version : 
9/10/2018 2:17:38 PM - 
9/10/2018 2:17:38 PM -  References         : 
9/10/2018 2:17:38 PM - Signature Details...
9/10/2018 2:17:38 PM -  Extension is not signed.
9/10/2018 2:17:38 PM - 
9/10/2018 2:17:38 PM - Searching for applicable products...
9/10/2018 2:17:38 PM - Found installed product - Global Location
9/10/2018 2:17:38 PM - Found installed product - Visual Studio Community 2017
9/10/2018 2:17:38 PM - VSIXInstaller.NoApplicableSKUsException: This extension is not installable on any currently installed products.
   at VSIXInstaller.App.GetInstallableData(String vsixPath, Boolean isRepairSupported, IEnumerable`1& skuData)
   at VSIXInstaller.App.Initialize(Boolean isRepairSupported)
   at VSIXInstaller.App.Initialize()
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()

… which I just noticed is referencing my install of Visual Studio, not VS Code. That's...odd.

I'm seeing the same problem (prompted for sign in, but not sign in provided). Entering the credentials manually doesn't help. I am behind a proxy in my office, which of course makes things more difficult to debug. I have the usual environment variables set to help (http_proxy, https_proxy, etc.), but I also have Proxifier available to make more tweaks if necessary.

Mac OS - 10.13.6
VS Code - 1.27.1
Extension Version - 0.1.1

I did a little more digging for my problem with the github.com connection with Little Snitch. It looks like something in the "Code Helper" app isn't honoring the proxy settings and is connecting to dc.services.visualstudio.com directly. When I added a proxy rule to force this to go through my company proxy, I got a normal prompt to sign in to GitHub in Safari and everything was fine.

Seems like something needs to get fixed with how the helper process is detecting proxy settings.

EDIT: It looks like this doesn't just affect signing in, but is true for all interactions with GitHub.

EDIT2: This also doesn't just apply to requests to dc.services.visualstudio.com, but also API requests made to api.github.com.

I also access my repository via GitHub Enterprise (we have an internal copy of the repo) and when I add proxy rules to route the public GitHub traffic to the right place, the GitHub Enterprise traffic doesn't work.

My proxy rules are routing anything from the "Code Helper" process that isn't to our internal server (github.mycompany.com) to the proxy server. Requests from that process that are to that server go directly.

When I have a local repository with both public and enterprise remotes, the public remotes are fine, but the enterprise remotes give me this error:

Fetching pull requests for remote 'enterprise' failed, please check if the url "..." is valid.

Doing a normal git fetch --all on the command line works fine.

Manually adding my credentials doesn't seem to work, on version 0.1.2 connecting to a github enterprise.

As soon as I hit save, I get the original popup to sign in to github and the settings entry updates itself to just have the "host" field.

Same problem here. When I click 'Sign In', I expect Code to open a web browser to authenticate to GitHub, but nothing happens, and the 'Error signing in' flash message appears immediately.

Output:

> git config --local --get branch.master.github-pr-owner-number
Error signing in to github.com: undefined

No proxies, no strange network setup, default browser is Chrome, and Code has no problem opening it when Cmd-clicking on links, for example.

If I add my credentials manually, it works.

@wesbland Thanks for the spelunking. It does look like your proxy is not being honored, not sure why :-/. dc.services.visualstudio.com is nothing related to the extension, that's the VSCode pinging the application insights service. That likely means that the problem with your proxy is affecting all of VSCode and not just the extension's connection.

@steven-foster There's a bug in the enterprise connection which is being tracked in #382. There's a fix in #411 if you want to build and try it locally, it should make things work for you with a personal access token

@bitfield I've added additional logging and error checking in master, so we can hopefully get to the bottom of why some people never get the popup, it should be in the next update.

@wesbland Thanks for the spelunking. It does look like your proxy is not being honored, not sure why :-/. dc.services.visualstudio.com is nothing related to the extension, that's the VSCode pinging the application insights service. That likely means that the problem with your proxy is affecting all of VSCode and not just the extension's connection.

You're right. I did end up adding a rule that just says that everything (that isn't to an internal site) from the "Code Helper" app should go through the proxy and I can see now that a bunch of api.github.com traffic is going there as well.

Obviously, I'd still like to see the proxy settings honored. 😄 I usually don't have to run the proxy app on my machine since most other apps honor it now (though this isn't the first time that they haven't).

Hi all I am stuck at the following point after following the instructions:
Make sure you have VSCode version 1.27.0 or higher
Download the extension from the marketplace
Reload VS Code after the installation (click the reload button next to the extension)

This point here I cannot see my repos.

Open your desired repo
Go to the SCM Viewlet, and you should see the GitHub Pull Request treeview.
A notification should appear asking you to sign in GitHub, follow the directions to authenticate
You should be good to go!

@masacuna I'm not sure what you mean by "I cannot see my repos" - are you not seeing the GitHub Pull Requests treeview? Note that on the first load, it will show up collapsed at the bottom of the viewlet. Please make sure that you have a folder open with a remote that points to GitHub. If you're still not seeing anything, what's the output of running git remote -v in this folder?

Ok I realize that I did not have git installed locally so I have followed those instructions. Now I am seeing that visual studio code is connected but not to the github website. I can see the repository connected on my github desktop but when i refresh the github website I cannot see the repo there. I have tried to publish it there but no luck. Thanks.

C:\Program Files\Git\cmd>git remote -v
fatal: not a git repository (or any of the parent directories): .git

@masacuna Let's move this conversation to a new issue since this is not related to the problem reported by this thread: https://github.com/Microsoft/vscode-pull-request-github/issues/456

There’s a fix on master now for this, if you want to try it out.

@wesbland Looks like some extensions are shipping with old versions of the application insights package that kinda breaks http requests, and it might be causing your proxying issues too. #449 has more details, but try disabling all your extensions to see if that makes things work.

@shana - It doesn't seem to have helped. I pretty much only had language extensions anyway since I just started VS Code because of this plugin.

This issue should be fixed in release 0.1.5 as part of the fix for #449. Please reopen if you find that you still never get a prompt to sign in.

Just got this error. This is the output:

[Info] Looking for git repository
[Info] Git repository found, initializing review manager and pr tree view.
[Info] Found GitHub remote
[Info] Error signing in to github.com: TypeError: Cannot set property 'text' of undefined
[Info] TypeError: Cannot set property 'text' of undefined
    at t.CredentialStore.willStartLogin (/Users/eric/.vscode/extensions/github.vscode-pull-request-github-0.8.0/media/extension.js:36:358635)
    at t.CredentialStore.<anonymous> (/Users/eric/.vscode/extensions/github.vscode-pull-request-github-0.8.0/media/extension.js:36:356720)
    at Generator.next (<anonymous>)
    at n (/Users/eric/.vscode/extensions/github.vscode-pull-request-github-0.8.0/media/extension.js:36:354529)
    at new Promise (<anonymous>)
    at n (/Users/eric/.vscode/extensions/github.vscode-pull-request-github-0.8.0/media/extension.js:36:354306)
    at t.CredentialStore.login (/Users/eric/.vscode/extensions/github.vscode-pull-request-github-0.8.0/media/extension.js:36:356515)
    at t.CredentialStore.<anonymous> (/Users/eric/.vscode/extensions/github.vscode-pull-request-github-0.8.0/media/extension.js:36:356396)
    at Generator.next (<anonymous>)
    at o (/Users/eric/.vscode/extensions/github.vscode-pull-request-github-0.8.0/media/extension.js:36:354362)
[Info] Error signing in to github.com: TypeError: Cannot set property 'text' of undefined
[Info] TypeError: Cannot set property 'text' of undefined
    at t.CredentialStore.willStartLogin (/Users/eric/.vscode/extensions/github.vscode-pull-request-github-0.8.0/media/extension.js:36:358635)
    at t.CredentialStore.<anonymous> (/Users/eric/.vscode/extensions/github.vscode-pull-request-github-0.8.0/media/extension.js:36:356720)
    at Generator.next (<anonymous>)
    at o (/Users/eric/.vscode/extensions/github.vscode-pull-request-github-0.8.0/media/extension.js:36:354362)
[Info] Error signing in to github.com: TypeError: Cannot set property 'text' of undefined
[Info] TypeError: Cannot set property 'text' of undefined
    at t.CredentialStore.willStartLogin (/Users/eric/.vscode/extensions/github.vscode-pull-request-github-0.8.0/media/extension.js:36:358635)
    at t.CredentialStore.<anonymous> (/Users/eric/.vscode/extensions/github.vscode-pull-request-github-0.8.0/media/extension.js:36:356720)
    at Generator.next (<anonymous>)
    at o (/Users/eric/.vscode/extensions/github.vscode-pull-request-github-0.8.0/media/extension.js:36:354362)
[Info] Error signing in to github.com: TypeError: Cannot set property 'text' of undefined
[Info] TypeError: Cannot set property 'text' of undefined
    at t.CredentialStore.willStartLogin (/Users/eric/.vscode/extensions/github.vscode-pull-request-github-0.8.0/media/extension.js:36:358635)
    at t.CredentialStore.<anonymous> (/Users/eric/.vscode/extensions/github.vscode-pull-request-github-0.8.0/media/extension.js:36:356720)
    at Generator.next (<anonymous>)
    at o (/Users/eric/.vscode/extensions/github.vscode-pull-request-github-0.8.0/media/extension.js:36:354362)
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Tyriar picture Tyriar  Â·  3Comments

scrossan-crown picture scrossan-crown  Â·  4Comments

kieferrm picture kieferrm  Â·  4Comments

alexdima picture alexdima  Â·  3Comments

Simran-B picture Simran-B  Â·  4Comments