Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

GitHub Enterprise error - Connection with GitHub Client failed #467

Closed
thetaylormcrae opened this issue Dec 9, 2018 · 26 comments
Closed

Comments

@thetaylormcrae
Copy link

thetaylormcrae commented Dec 9, 2018

Using the same steps listed in issue #395, this is what I'm seeing when accessing our GitHub Enterprise instance.

image

VSCode: 1.29.1
VSCode-GitHub extension: .30.1

Originally posted by @thetaylormcrae in https://github.com/KnisterPeter/vscode-github/issue_comments#issuecomment-445512014

@KnisterPeter
Copy link
Owner

@thetaylormcrae What OS are you on? Where in your path is your git binary installed?

@thetaylormcrae
Copy link
Author

@KnisterPeter : My OS is Windows 10 Pro build 1803 and Git binary is installed at C:\Program Files\Git.

@KnisterPeter
Copy link
Owner

@thetaylormcrae If you open a cmd terminal in windows and type 'git' does it work and find the command or does it fail? Right now the extension expects your git executable in your path. Otherwise you can try to configure github.gitCommand in vscode settings as path to your git executable.

@KnisterPeter
Copy link
Owner

@thetaylormcrae And after configuration you may need to run 'Reload window'.

@thetaylormcrae
Copy link
Author

I'm able to type 'git' into PowerShell / CMD and get back the 'These are common Git comands...' message. I'll try specifying the Git path using that option in VSCode and see if it makes a difference.

@KnisterPeter
Copy link
Owner

@thetaylormcrae It would be great if you can report back here. At least as reference for others if it did work.

@thetaylormcrae
Copy link
Author

thetaylormcrae commented Dec 10, 2018

@KnisterPeter : Unfortunately, I got the same error after specifying the full path to the git.exe file. Listed below is my user settings (json) file.

{
"gitlens.advanced.messages": {
"suppressShowKeyBindingsNotice": true
},

"gitlens.remotes": [
    {
        "domain": "github.ascension.org",
        "type": "GitHub"
    }
],

"github.gitCommand" : "C:/Program Files/Git/cmd/git.exe"
}

"markdown.extension.toc.orderedList": true,
"git.confirmSync": false,
"workbench.colorTheme": "Ayu Mirage",
"git.defaultCloneDirectory": "C:/Scripts/Repository-WorkInProgress",
"git.enableSmartCommit": true,
"pandoc.htmlOptString": "-s -t html5 -c css/style.css",
"window.zoomLevel": 0,
"git.autofetch": true,
"cSpell.language": "en"

}

also, my access token setup in VSCode has the following permissions
image

I've also confirmed that the GHE host is github.domain.org.

@KnisterPeter
Copy link
Owner

@thetaylormcrae Can you then please verify that your GHE is available at <protocol>//<hostname>/api/v3? Besides than this I have no clue what can go wrong. The error messages usally means that either your git binary is not found or the endpoint cannot be reached over network.

@thetaylormcrae
Copy link
Author

thetaylormcrae commented Dec 10, 2018

That is available at https://github.*domain*.org/api/v3 with the following response.

{
"message": "Must authenticate to access this API.",
"documentation_url": "https://developer.github.com/enterprise/2.15/v3"
}

Not sure if the GHE version of 2.15 makes a difference.

@KnisterPeter
Copy link
Owner

KnisterPeter commented Dec 10, 2018

No v3 should be good enough. I have no idea what else could have gone wrong. I'll flag this as bug and will have a look if I can find something

@KnisterPeter KnisterPeter added bug and removed question labels Dec 10, 2018
@thetaylormcrae
Copy link
Author

To see if it's a bug in VSCode 1.29.1, I'll load the latest Insider version and see if that makes a difference.

@KnisterPeter
Copy link
Owner

@thetaylormcrae It should not, since it does not use that many features of githubs internal git client.
You may open the output panel of this extension and have a look at the output there. At least this could give an indication of the urls which are called.
The error message at the top is thrown if the repositories from github could not be queried via api or some reason.

@thetaylormcrae
Copy link
Author

@KnisterPeter : Sounds good. Here's a fresh copy of the output
untitled

@KnisterPeter
Copy link
Owner

@thetaylormcrae Its clearly the request which fails. So either your token is not found (for whatever reason) or it has not enough access rights, or I don't know...

@thetaylormcrae
Copy link
Author

@KnisterPeter : Good to know. Is there any further debugging that can be enabled to see how the extension pulls in the token that's stored in VSCode?

@KnisterPeter
Copy link
Owner

@thetaylormcrae No, to get deeper into it you need to compile your own version of the extension.
Its not that hard tho. Clone the repo, open it in code, and start a debugging session.

@thetaylormcrae
Copy link
Author

@KnisterPeter : Sounds good! If I find anything that stands out for this issue, I'll make sure to report back here.

@thetaylormcrae
Copy link
Author

@KnisterPeter : Not sure what I'm doing wrong, but when I start a debug session after cloning the repository, this is what I get in the [Extension Development Host] instance:

Activating extension 'KnisterPeter.vscode-github' failed: Cannot find module 'C:\Scripts\vscode-github-1\out\src\main'.

@KnisterPeter
Copy link
Owner

Did you install all dependencies with yarn and started a build? The default build in vscode should work.

@thetaylormcrae
Copy link
Author

thetaylormcrae commented Dec 12, 2018

@KnisterPeter : My apologies. I didn't properly install the dependencies. After that was completed, the error is no longer present. After setting up the secure token and attempting to check pull requests on a GHE repository, I got the following error.

Extension 'KnisterPeter.vscode-github' uses a document selector without scheme. Learn more about this: https://go.microsoft.com/fwlink/?linkid=872305
[UriError]: Scheme is missing: {scheme: "", authority: "", path: "", query: "", fragment: ""}
Extension 'KnisterPeter.vscode-github' uses a document selector without scheme. Learn more about this: https://go.microsoft.com/fwlink/?linkid=872305
GET https://github.ascension.org/api/v3/user/repos 
Failed to connect to provider "Connection with GitHub Client failed. Please make sure your git executableis setup correct, and your token has enought access rights."
GET https://github.ascension.org/api/v3/user/repos 
GET https://github.ascension.org/api/v3/user/repos 
Failed to connect to provider "Connection with GitHub Client failed. Please make sure your git executableis setup correct, and your token has enought access rights."
GET https://github.ascension.org/api/v3/user/repos 
Error: Connection with GitHub Client failed. Please make sure your git executableis setup correct, and your token has enought access rights.
	at WorkflowManager.<anonymous> (C:\Scripts\vscode-github-1\out\src\workflow-manager.js:39:23)
	at Generator.throw (<anonymous>)
	at rejected (C:\Scripts\vscode-github-1\out\src\workflow-manager.js:14:65)
	at <anonymous>
	at process._tickCallback (internal/process/next_tick.js:188:7)

@KnisterPeter
Copy link
Owner

@thetaylormcrae Hmm, then the only option would be to set a breakpoint at apropriate positions or I create a branch with a few more log output for you to debug this further. Whatever is easier for you.

@thetaylormcrae
Copy link
Author

@KnisterPeter : I like the option of a separate branch to isolate the troubleshooting.

@thetaylormcrae
Copy link
Author

@KnisterPeter : What would I need to do to enable further logging on this extension? Digging through the code now, but not sure where to start.

@KnisterPeter
Copy link
Owner

@thetaylormcrae Sorry for not responding. I've had a busy time lately.
A good starting point would be this line https://github.com/KnisterPeter/vscode-github/blob/master/src/workflow-manager.ts#L81
Its the error you have in the logs regarding the provider connection.

By the way did you tried the github extension from microsoft? Its quite good and does a lot of this extension but better and they have a bigger team on it.

@thetaylormcrae
Copy link
Author

Thank you, @KnisterPeter ! I'll dig into that and see what I can find. In terms of the GitHub extension from Microsoft, I run into a similar issue where the extension doesn't seem to load. Interestingly enough, even though my remotes are HTTPS, it's asking about .ssh config.

[Info] C:\Users\TMCRA002\.ssh\config: ENOENT: no such file or directory, open 'C:\Users\TMCRA002\.ssh\config'
[Info] Looking for git repository
[Info] Git repository found, initializing review manager and pr tree view.
[Info] No GitHub remotes found
[Info] Review> no matching pull request metadata found for current branch develop
[Info] No GitHub remotes found
[Info] Review> no matching pull request metadata found for current branch develop

I'll let you know what I find on your extensions this week. :-).

@stale
Copy link

stale bot commented Jun 18, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jun 18, 2020
@stale stale bot closed this as completed Jun 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants