Gerrit patchset starting the build but not updating label

485 views
Skip to first unread message

Gaurav Negi

unread,
Aug 16, 2018, 9:09:31 PM8/16/18
to repo-d...@googlegroups.com
Dear All,
   All a sudden something strange is happening in our Gerrit system.
Gerrit is starting the jenkins build, 
But No build start and end message is being displayed in Gerrit.
Also the verification label after build pass or failure is not getting updated. 

I checked Jenkins job and it is not in silent mode. 

If I manually run query from jenkins slave, it is updating the Gerrit changeset. 

   ssh -p 29418 jen...@codereview.deepmap.ai gerrit review --label verified=+1 $GERRIT_PATCHSET_REVISION

However, by itself it is not putting any build message or updatign verification label. 

We are using Gerrit Version 2.14

Any help will be greatly appreciated. 

Thanks
-Gaurav

Duft Markus

unread,
Aug 17, 2018, 2:25:39 AM8/17/18
to Gaurav Negi, repo-d...@googlegroups.com

Hey,

 

From what I know about how Gerrit and Jenkins work together, this is not related to Gerrit. The Jenkins plugins listens to events on Gerrit (through SSH) and reacts by starting a build and posting the results. Gerrit does not do anything special to achieve this.

 

Issues that we have had in the past:

 

1)      The number of allowed SSH connections to Gerrit is exceeded, check with ssh <server> gerrit show-connections. The according settings in gerrit.config is sshd.maxConnectionsPerUser

2)      The connection (or some connections) of the Jenkins plugin broke down somehow. Check in the plugin settings by pressing the reconnect button. Otherwise try restarting Jenkins.

3)      Some sort of permission problem…?

 

Cheers,

Markus

--
--
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.


SSI Schäfer IT Solutions GmbH | Friesachstrasse 15 | 8114 Friesach | Austria
Registered Office: Friesach | Commercial Register: 49324 K | VAT no. ATU28654300
Commercial Court: Landesgericht für Zivilrechtssachen Graz

Gert van Dijk

unread,
Aug 17, 2018, 3:57:22 AM8/17/18
to Repo and Gerrit Discussion
Some things to check:

Gerrit-server-specific settings for the Jenkins plugin - Go to: Manage Jenkins -> Gerrit Trigger -> Wheel icon on the instance -> Click Advanced
  • Double-check the username set is the expected one ('jenkins', as you tested it with manually).
  • Did you correctly configure the interface to use: HTTP-REST vs SSH?
    untick Use REST API
  • Check the reporting values (is failed -1, success 1).
  • Check the command used to post Verified label. (these are flavored to my likes, such as notify, tag to have ability to hide in PG - not needed in future release)
    Success: gerrit review <CHANGE>,<PATCHSET> --message 'Build Successful <BUILDS_STATS>' --label Verified=<VERIFIED> --label Code-Review=<CODE_REVIEW> --tag "autogenerated:ci" --notify NONE
    Failed: gerrit review <CHANGE>,<PATCHSET> --message 'Build Failed <BUILDS_STATS>' --label Verified=<VERIFIED> --label Code-Review=<CODE_REVIEW> --tag "autogenerated:ci" --notify OWNER
  • Ensure that the commands above show a new-style "--label <label-name>=<VERIFIED>" and not old-style "--verified <VERIFIED>".
  • Does the verdict category listing includes Verified?
Then go to your Jenkins job configuration, to the Gerrit Trigger section, Click Advanced.
  • Ensure the right Gerrit instance is selected.
  • Ensure SIlent mode is disabled. (You already checked that)
  • Ensure Skip vote tickboxes all unticked.
  • Ensure Dynamic Trigger Configuration is set to what you expect - if enabled, check the contents of the file.
In Gerrit itself, check that the ACL settings are correct to permit Jenkins posting on that change's Verified label (you basically did that already, by posting as Jenkins).

Also:
If I manually run query from jenkins slave
Could you try this again from the Jenkins master? It's the master posting the results.

Does the Manual Trigger on patch sets from the UI work and post results? (On the main Jenkins screen, hit Query and Trigger Gerrit Patches) it should behave the same as an automatic trigger.

HTH
Reply all
Reply to author
Forward
0 new messages