I'm trying to use Jenkins with GitHub Enterprise. However, I keep getting HTTP Response Code -1, and message 'null'.
For repository owner/name, I've tried my own account name, account name/repo name, and then repo name, however, it had the same message.
I added my token by pressing the add credentials button, and added my token to the secret text.
I also sent the request to requestbin, which allows to analysis my http request, and it uses headers to pass the token key. I've tried the same curl command, but it works for me.
Has anyone encountered this before? Thanks
These are my settings for Jenkins and GitHub:
It doesn't work, since Jenkins complains that it cannot connect to GitHub in the logs with http error code -1, and message null.
Configuring GitHubStep 1: go to your GitHub repository and click on 'Settings'. Step 2: Click on Webhooks and then click on 'Add webhook'. Step 3: In the 'Payload URL' field, paste your Jenkins environment URL. At the end of this URL add /github-webhook/.
The GitHub Authentication Plugin provides a security realm to authenticate Jenkins users via GitHub OAuth. In the Global Security configuration choose the Security Realm to be GitHub Authentication Plugin. The settings to configure are: GitHub Web URI, GitHub API URI, Client ID, Client Secret, and OAuth Scope(s).
Jenkins scans your entire GitHub organization and creates Pipeline jobs for each repository containing a Jenkinsfile—a text file that defines the process of building, testing, and deploying your project using Jenkins.
I was able to solve it by upgrading to a newer Jenkins (now using 1.5) to 2.3.
Facts:
1. Request to requestbin works, whereas request to github.xxx.com does not work.
2. Curl request to github.xxx.com works
Assumptions:
1. Curl request was fired presumably from your local computer.If I go ahead and risk a guess, the curl command test probably was not done in the computer/server where jenkins is running from. If not, please ignore this point.
2. Github did not go crazy.
3. There was no human error
More facts:
1. Github plugin uses git client
2. Git client would return with a -1 when any error occurs. Usual convention - 0 is okay and any non zero is not okay.
Possibilities:
1. You could have hit a known issue in git client of Jenkins (may be https://issues.jenkins-ci.org/browse/JENKINS-20261) which was solved by upgrading to new version of jenkins, since jenkins upgrade requires some plugin upgrades.
2. DNS caching could be a problem in your Jenkins computer/server
3. Your Jenkins server/computer was out of your VPN for sometime and came back into VPN exactly after you completed upgrade.
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With