3

TL;DR: This is a bug. There is a bug report. https://issues.jenkins-ci.org/browse/JENKINS-54051

I am trying to set up the API endpoint for Jenkins to know how to communicate with a GitHub Enterprise Server.

I am working behind a corporate proxy (though the error persists whether or not I have the proxy turned on) and my enterprise github has a custom CA cert that I think I've installed, but in either case I don't think that's the issue since I can't even connect it to the normal github api either. Here the is the error I am getting:

Picture of Error

This error is for any endpoint, including https://github.myenterprise.com/api/v3 and https://api.github.com/ and even https://google.com. I can access these 3 sites through firefox without errors, and the github ones display the JSON stuff that I think I should get:

{
  "current_user_url": "https://api.github.com/user",
  "current_user_authorizations_html_url": "https://github.com/settings/connections/applications{/client_id}",
  "authorizations_url": "https://api.github.com/authorizations",
  ...
}

If I google "This URL requires POST" there are only 3 results, none of which relate to Jenkins. I have very limited API / HTML / REST experience and have no idea what to try to fix this.

3
  • I just installed the newest Jenkins yesterday and ran into the exact same issue. I think the problem is that the URL you see in the error is being accessed with a GET by the browser, when the Jenkins API requires it be accessed with POST. I suspect this is a bug in Jenkins. Have you submitted it to the Jenkins team? Commented Jul 14, 2018 at 18:19
  • @NathanAldenSr, no, I have not Commented Jul 14, 2018 at 20:14
  • 1
    I've created an issue, as it is not fixed yet. issues.jenkins-ci.org/browse/JENKINS-53828
    – gabel
    Commented Sep 28, 2018 at 6:17

1 Answer 1

2

It does look like this is a bug or mismatch between the latest versions of the github-branch-source plugin (v2.3.6) and the github plugin (v1.29.1). From a quick triage it looks like the affected call is https://github.com/jenkinsci/github-branch-source-plugin/blame/5646416554d58fe224be382baa021df1b601f302/src/main/java/org/jenkinsci/plugins/github_branch_source/Endpoint.java#L154 and the related changeset at https://github.com/jenkinsci/github-branch-source-plugin/commit/22d3383002274bc3f4368534eba2b5c852e78b39. This should be raised with the maintainers of the plugins concerned, unfortunately I'm off on holiday and don't have time to do this, but just posting my findings here to help the community in the meantime.

I don't advise this, but a workaround is to downgrade to the previous versions of the plugins: git 3.9.0, github 1.29.0 and github-branch-source 2.3.4 (only a good idea if your network is airgapped). Those plugin versions contains the serverside request forgery bugs so beware.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .