Gerrit trigger in Jenkins not starting builds

2,718 views
Skip to first unread message

Gaurav Negi

unread,
Mar 4, 2016, 8:13:31 PM3/4/16
to Repo and Gerrit Discussion
Dear Gerrit experts,
    I am using Gerrit 2.10 integrated with Jenkins via "Gerrit Trigger" of Jenkins.

1. In Jenkins Created a Gerrit server and I can see it has started and green. 

2. Problem is when I am pushing a new commit to Gerrit, Jenkins is triggering the new build.
Even though the build job is based on "Gerrit Event"

It was working with older instance of Gerrit. I created a new instance of Gerrit, it stopped working. 

Any input will be highly appreciated.

On Jenkins, I am seeing this error. 



   Mar 4, 2016 5:03:20 PM com.sonymobile.tools.gerrit.gerritevents.GerritConnection connect

SEVERE: IOException: 

com.sonymobile.tools.gerrit.gerritevents.ssh.SshException: com.jcraft.jsch.JSchException: java.net.ConnectException: Connection refused

at com.sonymobile.tools.gerrit.gerritevents.ssh.SshConnectionImpl.connect(SshConnectionImpl.java:181)

at com.sonymobile.tools.gerrit.gerritevents.ssh.SshConnectionFactory.getConnection(SshConnectionFactory.java:98)

at com.sonymobile.tools.gerrit.gerritevents.GerritConnection.connect(GerritConnection.java:380)

at com.sonymobile.tools.gerrit.gerritevents.GerritConnection.run(GerritConnection.java:306)

Caused by: com.jcraft.jsch.JSchException: java.net.ConnectException: Connection refused

at com.jcraft.jsch.Util.createSocket(Util.java:344)

at com.jcraft.jsch.Session.connect(Session.java:215)

at com.jcraft.jsch.Session.connect(Session.java:183)

at com.sonymobile.tools.gerrit.gerritevents.ssh.SshConnectionImpl.connect(SshConnectionImpl.java:177)

... 3 more


When I am trying to retrigger older jenkins builds. Getting this message.

A problem occurred while processing the request. Please check our bug tracker to see if a similar problem has already been reported. If it is already reported, please vote and put a comment on it to let us gauge the impact of the problem. If you think this is a new issue, please file a new issue. When you file an issue, make sure to add the entire stack trace, along with the version of Jenkins and relevant plugins. The users list might be also useful in understanding what has happened.

Stack trace

javax.servlet.ServletException: java.lang.NoClassDefFoundError: java/lang/ReflectiveOperationException
	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:795)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:875)
	at org.kohsuke.stapler.MetaClass$12.dispatch(MetaClass.java:391)
	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:745)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:875)
	at org.kohsuke.stapler.MetaClass$12.dispatch(MetaClass.java:391)

Gaurav Negi

unread,
Mar 4, 2016, 8:52:59 PM3/4/16
to Repo and Gerrit Discussion
1. I installed Gerrit 2.10 and integrated it with Jenkins.
2. On jenkins side I have installed "Gerrit Trigger" plugin. 

Followed all steps as mentioned here

3. Also created a jenkins job, that will get triggered by "Gerrit Event", picked right Gerrit server. etc

But not sure why, the jenkins jobs is not getting triggered when I push a new commit to Gerrit. 

Any input or where to look for is highly appreciated.

Thanks
-Gaurav

Inline image 1

Inline image 2

Gaurav Negi

unread,
Mar 7, 2016, 6:56:57 PM3/7/16
to Repo and Gerrit Discussion
All,
   The issue was the Java version. 
I was using open jdk 1.6 on Jenkins master.
"Gerrit Trigger" plugin works on jdk 1.7. 

After Upgrading to JDK 1.7, it started working.

Thanks
-Gaurav

David Ostrovsky

unread,
Mar 8, 2016, 2:52:41 AM3/8/16
to Repo and Gerrit Discussion

Am Dienstag, 8. März 2016 00:56:57 UTC+1 schrieb Gaurav Negi:
All,
   The issue was the Java version. 
I was using open jdk 1.6 on Jenkins master.
"Gerrit Trigger" plugin works on jdk 1.7. 

After Upgrading to JDK 1.7, it started working.

David Pursehouse

unread,
Mar 8, 2016, 3:05:17 AM3/8/16
to David Ostrovsky, Repo and Gerrit Discussion
*sigh* If only someone had commented on the commit that broke it, I
would have fixed this already.

Should be fixed by this PR:

https://github.com/jenkinsci/gerrit-trigger-plugin/pull/276

David Pursehouse

unread,
Mar 11, 2016, 12:31:15 AM3/11/16
to David Ostrovsky, Repo and Gerrit Discussion, Gaurav Negi
Java 6 runtime compatibility is fixed in version 2.18.4 of the Gerrit
Trigger Plugin.

David Ostrovsky

unread,
Mar 11, 2016, 1:52:17 AM3/11/16
to Repo and Gerrit Discussion, gaura...@gmail.com
Thanks for the quick fix, David.

Gaurav Negi

unread,
Mar 11, 2016, 1:58:31 AM3/11/16
to David Pursehouse, David Ostrovsky, Repo and Gerrit Discussion
Thanks David, I was using Openjdk1.6 on Jenkins master.
I was seeing the issue there with Gerrit Trigger plugin version 2.18.4
It got fixed when I upgraded to Openjdk 1.7



Sent from my iPhone

David Pursehouse

unread,
Mar 11, 2016, 2:02:16 AM3/11/16
to David Ostrovsky, Repo and Gerrit Discussion, gaura...@gmail.com
No problem. I would have already fixed it in October if I'd known about
it :-/

Bobby also added the "animal sniffer" plugin to the test phase of the
build, which will detect runtime violations and prevent this kind of bug
from happening again.

Anushree Ganjam

unread,
May 9, 2016, 2:20:17 AM5/9/16
to Repo and Gerrit Discussion
Hi,

Jenkins version : 1.647
Gerrit Trigger : 2.18.3

AWS Server configuration
16 Cores, 30GB RAM.

We have setup gerrit and jenkins in AWS systems for Android ecosystem.
When a +1 is given in gerrit, we want jenkins to start the android build.
The jenkins jobs works well sometimes, but misses the event many times.
Only if we restart the jenkins , the job starts working well.
But after sometime same problem happens.
We have internal memory of 99GB where jenkins is installed and jobs-> workspace is in /mnt folder of AWS. There is no problem in output of the job.
Problem is that job is not starting for gerrit event. How do we solve this?

Thanks for the help in advance

Matthias Sohn

unread,
May 9, 2016, 2:42:18 AM5/9/16
to Anushree Ganjam, Repo and Gerrit Discussion
did you try to configure gerrit-trigger's watchdog ?

the watchdog configuration is hidden here:
Manage Jenkins > Gerrit Trigger > Edit > Advanced > Watchdog

You could also try the missed event replay feature [1]


-Matthias

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anushree Ganjam

unread,
May 9, 2016, 2:59:50 AM5/9/16
to Repo and Gerrit Discussion, anushre...@gmail.com
Hi,
Connection Watchdog Timeout is set to 0
Should i change this value?


Now, Everyday i am restarting jenkins since the changes on gerrit is not triggering builds on jenkins.

Matthias Sohn

unread,
May 9, 2016, 3:06:03 AM5/9/16
to Anushree Ganjam, Repo and Gerrit Discussion
according to the documentation the watchdog is switched off if timeout is 0. 
I have set it to 10 minutes and switched off the watchdog on the weekend since we don't expect changes on the weekend

Anushree Ganjam

unread,
May 9, 2016, 3:14:04 AM5/9/16
to Repo and Gerrit Discussion, anushre...@gmail.com
Thanks a lot Matthias Sohn,
I have added 10 now.

As per the explanation : The time in minutes the watchdog should wait for any events from Gerrit before the connection is restarted.
Does this mean, for every 10minutes, if there is no event from gerrit to jenkins -> Will it restart the connection?
Where can we check the logs for this connection restart?

Anushree Ganjam

unread,
May 10, 2016, 4:48:00 AM5/10/16
to Repo and Gerrit Discussion, anushre...@gmail.com
Facing same problem again today.
Can anyone guide me please how to check the connection logs between jenkins and gerrit.
How to check watchdog logs for connection restart?

Please help.

Anushree Ganjam

unread,
May 16, 2016, 1:17:04 AM5/16/16
to Repo and Gerrit Discussion, anushre...@gmail.com
Hi,
For 4days the gerrit trigger was working well.
Today gerrit trigger stopped working.
Today again I had to restart the jenkins for this to work well.
Please can anyone guide me on why is this problem happening?


On Monday, May 9, 2016 at 12:12:18 PM UTC+5:30, Matthias Sohn wrote:

manideep lanka

unread,
Mar 22, 2018, 4:57:32 AM3/22/18
to Repo and Gerrit Discussion
Hi Anushree!
I am trying to setup jenkins trigger too. But I get this error: Connection error : com.jcraft.jsch.JSchException: java.net.UnknownHostException.
Can you guide me or point me to some resource on how to configure the Gerrit trigger plugin?

Gert van Dijk

unread,
Mar 22, 2018, 6:32:48 AM3/22/18
to Repo and Gerrit Discussion
UnknownHostException is most likely related to DNS; failure to resolve a hostname to an IP address. Do you get this error on a build that triggered or in general when starting Jenkins and configuring the plugin?

Verify that the connection to Gerrit can be set up in Manage Jenkins -> Gerrit Trigger -> Gerrit Servers section and displays the Gerrit version etc.
Reply all
Reply to author
Forward
0 new messages