9

I'm trying to use Jenkins with GitHub Enterprise. However, I keep getting HTTP Response Code -1, and message 'null'.

enter image description here

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.

enter image description here

I added my token by pressing the add credentials button, and added my token to the secret text.

enter image description here

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:

enter image description here

enter image description here

enter image description here

enter image description here

It doesn't work, since Jenkins complains that it cannot connect to GitHub in the logs with http error code -1, and message null.

4
  • There's no such HTTP error code, as you probably know. I expect it's a failure inside the client before it tries to connect, but it might be worth looking in the GitHub enterprise web server logs to see if it did connect, or watching the connection with tcpdump, or similar. If it does manage to connect then I expect something's going wrong before it gets to HTTP, e.g. in the SSL negotiation. Can you access that URL yourself manually, or e.g. using curl from the Jenkins server? Are there any error logs with Jenkins?
    – Rup
    Commented May 11, 2016 at 22:44
  • I was able to use curl from the Jenkins server, from my laptop, and it works perfectly, except Jenkins. I think it says -1 because it couldn't find any error code that matches it. Commented May 11, 2016 at 22:53
  • OK - then can you have a look in the logs to try and find out if there are any details of the error there then, before it fails to match it to a code for display?
    – Rup
    Commented May 11, 2016 at 22:59
  • In Jenkins, it looks like it has the same error -1 and null for message. I also tried to do a request.bin to see what it is sending out, which seems correct. It looks like my next step is to look at the GitHub enterprise logs? Commented May 11, 2016 at 23:25

2 Answers 2

5

I was able to solve it by upgrading to a newer Jenkins (now using 1.5) to 2.3.

3
+25

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.

1
  • Issues with proxy settings also appear to cause these symptoms as well.
    – Al Neill
    Commented Mar 15, 2017 at 17:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.