Create Pluggable SCM error?

103 views
Skip to first unread message

Emil

unread,
Apr 22, 2021, 9:33:10 AM4/22/21
to go-cd
Hi Folks,

I am unable to Create Pluggable SCM with "Github Pull Requests Builder" because of the following error:
Check connection failed. Reason(s): check connection failed. {"message":"Not Found","documentation_url":"https://docs.github.com/rest/reference/repos#get-a-repository"}

My Github is an Enterprise instance on the local network. I have also configured the "Github Pull Requests status notifier" just in case as I thought it could be related.

Any ideas how can I troubleshoot this please?

Thanks for your help!
Emil

Sriram Narayanan

unread,
Apr 22, 2021, 9:54:05 AM4/22/21
to go...@googlegroups.com
On Thu, Apr 22, 2021 at 9:33 PM Emil <emil....@gmail.com> wrote:
Hi Folks,

I am unable to Create Pluggable SCM with "Github Pull Requests Builder" because of the following error:
Check connection failed. Reason(s): check connection failed. {"message":"Not Found","documentation_url":"https://docs.github.com/rest/reference/repos#get-a-repository"}

This is a response returned by the Github instance: https://docs.github.com/en/rest/reference/repos#get-a-repository

Resource not found

Status: 404 Not Found
 
Your credentials are correct ( hence it authenticated you).

Could you check the URL for typos in the the repo name?

Could you independently verify the existence of and access to the repository via a web browser and/or via curl?



My Github is an Enterprise instance on the local network. I have also configured the "Github Pull Requests status notifier" just in case as I thought it could be related.

Any ideas how can I troubleshoot this please?

Thanks for your help!
Emil

--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/fd6d53dd-d7b2-4f94-a64b-1b8e45f360b7n%40googlegroups.com.

Emil

unread,
Apr 26, 2021, 4:08:31 AM4/26/21
to go-cd
This is really odd if the connection is authenticated and it cannot find the repo... 
I have copied & pasted the URL from the actual repo. I am also using the very same URL a material and I am puzzled what I might be doing wrong!?
It is internal Enterprise instance of GitHub and I am using SSH. My URL is simply this: git@github:test-repo/python-build.git where github is the hostname.

For the configuration of the GitHub Pull Requests plugin I have added /api/v3/ to the hosname url as described in the documentation here - Is there something similar for the pluggable scm?

Sriram Narayanan

unread,
Apr 26, 2021, 4:40:26 AM4/26/21
to go...@googlegroups.com
On Mon, Apr 26, 2021 at 4:08 PM Emil <emil....@gmail.com> wrote:
This is really odd if the connection is authenticated and it cannot find the repo... 
I have copied & pasted the URL from the actual repo. I am also using the very same URL a material and I am puzzled what I might be doing wrong!?
It is internal Enterprise instance of GitHub and I am using SSH. My URL is simply this: git@github:test-repo/python-build.git where github is the hostname.

For the configuration of the GitHub Pull Requests plugin I have added /api/v3/ to the hosname url as described in the documentation here - Is there something similar for the pluggable scm?


You know, I'd responded earlier that the authentication had succeeded after browsing the Github side code (via their library). Given that you are using SSH, I'm not sure if Github is providing an informative response code. I suggest that you see which of the test cases you can match with as part of your tests.
 


On Thursday, 22 April 2021 at 14:54:05 UTC+1 srir...@gmail.com wrote:
On Thu, Apr 22, 2021 at 9:33 PM Emil <emil....@gmail.com> wrote:
Hi Folks,

I am unable to Create Pluggable SCM with "Github Pull Requests Builder" because of the following error:
Check connection failed. Reason(s): check connection failed. {"message":"Not Found","documentation_url":"https://docs.github.com/rest/reference/repos#get-a-repository"}

This is a response returned by the Github instance: https://docs.github.com/en/rest/reference/repos#get-a-repository

Resource not found

Status: 404 Not Found
 
Your credentials are correct ( hence it authenticated you).

Could you check the URL for typos in the the repo name?

Could you independently verify the existence of and access to the repository via a web browser and/or via curl?



My Github is an Enterprise instance on the local network. I have also configured the "Github Pull Requests status notifier" just in case as I thought it could be related.

Any ideas how can I troubleshoot this please?

Thanks for your help!
Emil

--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/fd6d53dd-d7b2-4f94-a64b-1b8e45f360b7n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+un...@googlegroups.com.

Emil

unread,
Apr 26, 2021, 11:43:04 AM4/26/21
to go-cd
Like you said, my call gets authenticated - I used HTTPS to test (used curl & postman) and I could get  the same error with 404 "Not Found" response, but only if the endpoint/url is wrong - I could reproduce the error using curl and postman, but ONLY when I enter invalid url/api endpoint...

The only issue I had to solve with the manual testing is I had to DISABLE the cert validation, because our github instance is using self signed certificate - but this will not explain when I use SSH in GoCD so I guess GoCD could be sending the request to invalid endpoint/url!?

Next, I'll try to trace the request, but meanwhile please suggest should you have any other ideas...

Thanks!

Ashwanth Kumar

unread,
Apr 27, 2021, 1:43:02 AM4/27/21
to go...@googlegroups.com
Emil, I'm one of the authors of the Plugin you're running into issue with. On the README of the plugin, there would be a section on configuring the Github Enterprise Endpoint. I'm assuming you've done that? 

If yes, can you please share some relevant sections of the plugin logs that might also be helpful in finding what's going wrong. 

Thanks,



--

Ashwanth Kumar / ashwanthkumar.in

Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Emil

unread,
Apr 27, 2021, 8:21:48 AM4/27/21
to go-cd
 Hi Ashwanth,

I appreciate your help and thanks for the great work on the plugin!

I decided to start again from scratch re-configuring the plugin, hoping to get across something obvious that I have missed. I only changed the user/password with user/accessToken in the config. I got a CA cert error because out github instance uses self-signed certificate and after importing the cert to the java cacerts for both GoCD server and agent I got error: Check connection failed. Reason(s): check connection failed. Server returned HTTP response code: 401 for URL: https://github/api/v3/repos/devops/python-build
gocd-create-scm.png

The server log files (I hope these are the correct log files):
  • plugin-github.pr.status.log
2021-04-26 17:40:16,581 INFO  [qtp1648030342-37] GitHubProvider:72 - Validating configuration
2021-04-26 17:43:59,552 INFO  [qtp1648030342-30] GitHubProvider:72 - Validating configuration
  • plugin-git-path.log
2021-04-27 09:47:50,742 INFO  [Thread-78] GitPathMaterialPlugin:72 - Loading GitPathMaterialPlugin...
2021-04-27 09:47:51,005 INFO  [Thread-78] HelperFactory:82 - Command line git found [git version 2.31.1.windows.1]
2021-04-27 09:47:51,006 INFO  [Thread-78] GitPathMaterialPlugin:82 - Type is CMD
2021-04-27 09:47:53,251 ERROR [Thread-78] JsonUtils:127 - go.plugin-settings.get-configuration failed
2021-04-27 09:47:53,292 ERROR [Thread-78] JsonUtils:127 - go.plugin-settings.get-view failed


Here is the contents of my current ~/.github:

login=build-user
accessToken=<pat:******************>

I couldn't find anything obvious apart from the git path config failure, could this be an issue?

Thank you for your help in advance
Emil

Emil

unread,
Apr 27, 2021, 9:51:21 AM4/27/21
to go-cd
Ashwanth,

I have copied the url (https://github/api/v3/repos/devops/python-build) from the 401 error message (reported in my earlier post) and I have successfully hit the GitHub API using postman & curl using the very same url reported by the error message:
gocd-disprove-401.png

It looks like there is no issue with the URL and the 401 error is misleading. I wonder if I have hit a configuration bug related to a private GitHub instance... ?!

I shall wait to hear your thoughts and if there are any other trouble shooting steps I can take...

Thanks again,
Emil

Ashwanth Kumar

unread,
Apr 27, 2021, 10:09:34 AM4/27/21
to go...@googlegroups.com
I have never used a Github Enterprise setup before, but judging from the Postman output and the error you get on the Validation screen. Doesn't the API need any creds to access it? Because on the Postman I can see the owner as "devops" (not sure if it's the default user for unauthenticated requests)?

Also can you share the output of cURL command with a -v from the GoCD Server machine? 

Thanks,

Emil

unread,
Apr 27, 2021, 11:09:57 AM4/27/21
to go-cd
I guess the only difference between the Enterprise setup and the public GitHub is the difference in API url as described in the README:
and may be this difference might be the reason for a code bug explaining this 401 error. 

In my postman screenshot above I am using basic authentication and you can see it is inheriting the authentication from the root collection where this request is sitting under, so to answer your question yes there is authentication but I chose this way to hide the user/pat details.

Please find attached the verbose output of the curl from the GoCD server as requested. the log file does not have the json response, but I guess you don't need it. Let me know if you need anything else. 
Thanks,
Emil
git-pr-curl-req.log

Sriram Narayanan

unread,
Apr 27, 2021, 11:26:26 AM4/27/21
to go...@googlegroups.com
Could you check what the Github Enterprise logs state when you try to connect via GoCD? 

-- Ram

Sriram Narayanan

unread,
Apr 27, 2021, 11:41:25 AM4/27/21
to go...@googlegroups.com
On Tue, Apr 27, 2021 at 9:51 PM Emil <emil....@gmail.com> wrote:
Ashwanth,

I have copied the url (https://github/api/v3/repos/devops/python-build) from the 401 error message (reported in my earlier post) and I have successfully hit the GitHub API using postman & curl using the very same url reported by the error message:
gocd-disprove-401.png

It looks like there is no issue with the URL and the 401 error is misleading. I wonder if I have hit a configuration bug related to a private GitHub instance... ?!

I shall wait to hear your thoughts and if there are any other trouble shooting steps I can take...

From the screenshot, it appears that you used the "devops" user to log in via Postman. The error in your earlier screenshot shows a 401 (which is "Requires Authentication" as per https://docs.github.com/en/rest/reference/repos#get-a-repository).

Since you've shown that you are able to use the build-user to curl, could you check if the build-user's access token is correct in the ~/.github file?

Similarly, could you check if you are able to use the devops user instead of build-user via GoCD?

-- Ram

 

Sriram Narayanan

unread,
Apr 27, 2021, 12:12:13 PM4/27/21
to go...@googlegroups.com
On Tue, Apr 27, 2021 at 11:40 PM Sriram Narayanan <srir...@gmail.com> wrote:


On Tue, Apr 27, 2021 at 9:51 PM Emil <emil....@gmail.com> wrote:
Ashwanth,

I have copied the url (https://github/api/v3/repos/devops/python-build) from the 401 error message (reported in my earlier post) and I have successfully hit the GitHub API using postman & curl using the very same url reported by the error message:
gocd-disprove-401.png

It looks like there is no issue with the URL and the 401 error is misleading. I wonder if I have hit a configuration bug related to a private GitHub instance... ?!

I shall wait to hear your thoughts and if there are any other trouble shooting steps I can take...

From the screenshot, it appears that you used the "devops" user to log in via Postman. The error in your earlier screenshot shows a 401 (which is "Requires Authentication" as per https://docs.github.com/en/rest/reference/repos#get-a-repository).

I was looking earlier in the thread. Earlier a few days ago, you'd got a 404. Now, you're getting a 401. It seems to me that you've got a password related issue this time. 

Emil

unread,
Apr 28, 2021, 8:17:43 AM4/28/21
to go-cd
Error SOLVED:
Thanks for pointing out the 404 became 401 - in my mind I was still treating the 401 as 404 and that's why my comments were not related to an authentication problem, but a URL/endpoint configuration problem - this is why my postman/curl was working but GoCD was reporting 40 because the config for the password/pat was wrong.
As per my previous post I had changed to use personal access token (PAT) instead of password, but the RREADME is no very clear on the distinction between accessToken and oauth - I posted my configuration earlier and I was using accessToken. As soon as I changed it to oauth my 401 went away, so my current working config with GitHub Enterprise is:

login=build-user
oauth=<pat:******************>

Now, I can confirm I can successfully create a SCM for "Pull Requests Builder", however when creating SCM for "Git Path Material Plugin" I get error: Check connection failed. Reason(s): ls-remote failed 
gocd-git-path-material-plugin-error.png

I can successfully run the git command on the GoCD server without error:
     git ls-remote git@github:devops/dev-utils.git

Any ideas how to solve this one, please? 

Thanks in advance

Sriram Narayanan

unread,
Apr 28, 2021, 9:42:02 AM4/28/21
to go...@googlegroups.com
Great!

May I request you to start a fresh thread on this second issue, please?

-- Ram

Sriram Narayanan

unread,
Apr 28, 2021, 9:44:44 AM4/28/21
to go...@googlegroups.com
On Wed, Apr 28, 2021 at 9:41 PM Sriram Narayanan <srir...@gmail.com> wrote:
Great!

May I request you to start a fresh thread on this second issue, please?

Context: This is a completely different plugin, and some of the active committers to the plugin are on this mailing list. A fresh email with a relevant subject line with catch their attention. (I'm going to look into this a bit myself regardless).

-- Ram
Reply all
Reply to author
Forward
0 new messages