gitblit-org / gitblit

pure java git solution
http://gitblit.com
Apache License 2.0
2.26k stars 670 forks source link

jenkins.groovy throws java.net.SocketException: Connection reset #1139

Open melo0187 opened 7 years ago

melo0187 commented 7 years ago

I have both GitBlit and Jenkins running in Tomcat on the same server. Whenever my repository triggers the Jenkins script as post-receive action nothing happens in Jenkins and I find the following in my Tomcat log instead:

2016-10-22 15:35:57 [INFO ] jenkins hook triggered by melo for ~melo/my_cv.git
2016-10-22 15:35:57 [ERROR] Failed to execute Groovy script jenkins.groovy
java.net.SocketException: Connection reset
[...]

Full log here.

I added another log line to the groovy script to log the entire triggerUrl and the URL is correct. When I just curl that URL from the same server where GitBlit and Jenkins run, there is no error and the Jenkins job runs.

Do you have any idea what could cause this problem? I don't know what more I could check.

Thanks in advance for any feedback!

chandresha1 commented 6 years ago

Hi ,

Did you find any answer for this problem?

melo0187 commented 6 years ago

Oh wow, it's been a while, so I'm not sure if I remember.

I believe something with the SSL handshake went wrong or something of that sort... When I look at my current gitblit.properties I have this for the groovy.JenkinsServer: groovy.JenkinsServer=http://localhost:7070/jenkins

This is possible because both GitBlit and Jenkins run on the same host in my case, obviously.

I believe this made things work for me. When using the internet facing https URL instead, which hits a Tomcat dedicated virtual host that is reverse proxied to Tomcat, it failed. Honestly I don't know why. The certificate is a valid one from Let's Encrypt.

Not sure if that is really helping you...