+1 Verified isn't getting set by Jenkins

5,412 views
Skip to first unread message

Douglas Alan

unread,
Nov 29, 2011, 9:21:27 PM11/29/11
to repo-d...@googlegroups.com
Hi. I've just set up a Gerrit server and have gotten it working with the Jenkins Gerrit-Trigger plugin. Everything works fine except two things:

  • The +1 Verified label is not getting automatically applied to a commit when the build for it succeeds in Jenkins.
Jenkins does see and build the commit right away, but the fact that the commit passed its test is not getting passed back to Gerrit. I can apply "+1 Verified" manually to a patch set, and that works, but this mode of operation is not particularly ideal. (Some other points of information: I can issue Gerrit queries in Jenkins under "Query and Trigger Gerrit Patches". This works, but if I trigger a selected search result in order to trigger a build, it still doesn't result in the "+1 Verified" making it to Gerrit. Additionally, the Gerrit user that Jenkins uses to do this is authorized to apply +1 Verified to refs/* in Gerrit.
  • The yellow "Loading ..." notification that appears at the top middle of the screen for just a flickering moment when things are working smoothly, often doesn't go away, even though whatever was being done seems to have completed. The "Loading ..." notification can stay there for a very long time. I'll have a hard time convincing people here to adopt Gerrit if it seems flakey.
These issues (or at least the first two) occur with both Gerrit 2.2.1 and 2.1.8, and using both Safari and Chrome.

Any ideas?

|>ouglas

P.S. Is there a way to make it so that new OpenId accounts need to be approved, rather than just having everyone who clicks on "Sign In" automatically getting an account?

P.P.S. I'm running Gerrit with bin/gerrit.sh start.

Jason Axelson

unread,
Nov 29, 2011, 9:56:14 PM11/29/11
to Douglas Alan, repo-d...@googlegroups.com
Assuming this [1] is the gerrit plugin you're using you should verify
that in the gerrit trigger settings (under
manage-jenkins->gerrit-trigger) that success is set to 1 and failed is
set to -1. Although I think those are the defaults.

[1] https://wiki.jenkins-ci.org/display/JENKINS/Gerrit+Trigger

Jason

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

Douglas Alan

unread,
Nov 30, 2011, 1:03:27 AM11/30/11
to Jason Axelson, repo-d...@googlegroups.com
On Tue, Nov 29, 2011 at 9:56 PM, Jason Axelson <jaxe...@referentia.com> wrote:

> Assuming this [1] is the gerrit plugin you're using you should verify
> that in the gerrit trigger settings (under
> manage-jenkins->gerrit-trigger) that success is set to 1 and failed is
> set to -1. Although I think those are the defaults.

Yes, those are set correctly, but I now have a better inkling of
what's going on. I found in the Gerrit Trigger Jenkins config the
section that specifies the ssh commands that are issued to Gerrit's
built-in ssh server. I've been able to successfully get the "+1
Verified" into Gerrit by typing the following to bash:

  $ ssh jenkins@gerrithost -p 29418  gerrit review --project
gerrit-sandbox --message=Hi --verified 1 10,1

The apparent cause of the problem is that while the above succeeds, it
never actually returns. This explains why I've been seeing comments in
Gerrit that look like this:

Jenkins Nov 29
Patch Set 1:
Build Started
http://jenkins.foo.org:28080/jenkins/job/Gerrit%20Sandbox%20(for%20review)/27/

I.e., the ssh command that tells Gerrit that the build has started
succeeds, but then it never returns. So then Jenkins never gets around
to issuing the ssh command that sends the "Verify +1", since Jenkins
is still waiting for the previous ssh command to finish.

If I put in a nonexistent change id into the ssh command, on the other
hand, the ssh *does* return, after outputting an error message.

Any ideas what might be causing this problem?

|>ouglas

Roland Schulz

unread,
Nov 30, 2011, 1:23:13 AM11/30/11
to Douglas Alan, repo-d...@googlegroups.com
Maybe a silly question. But did you make sure that the jenkins user has "Label Verified" permissions? I first forgot that and had the same behavior. And it is a bit confusing because you don't get any error message suggesting that it might be a permission problem. I would make sure that the review command works if you execute it manually.

Roland

|>ouglas



--
ORNL/UT Center for Molecular Biophysics cmb.ornl.gov
865-241-1537, ORNL PO BOX 2008 MS6309

Douglas Alan

unread,
Nov 30, 2011, 1:59:20 AM11/30/11
to Roland Schulz, repo-d...@googlegroups.com
> Maybe a silly question. But did you make sure that the jenkins user has
> "Label Verified" permissions? I first forgot that and had the same behavior.
> And it is a bit confusing because you don't get any error message suggesting
> that it might be a permission problem. I would make sure that the review
> command works if you execute it manually.

The review command does actually work when I execute it manually.
Although it never returns, as I mentioned in my previous message. I'm
guessing that it's the not-returning issue that is causing the
problem.

As to whether the jenkins user has the "Label Verified" permissions,
the Jenkins user is in the "Non-Interactive Users" group and the
All-Projects project grants -1/+1 Label Verified on refs/* to
Non-Interactive Users. The gerrit-sandbox project is set with "Rights
Inherit From: All-Projects".

|>ouglas

Matthias Sohn

unread,
Nov 30, 2011, 3:03:46 AM11/30/11
to Douglas Alan, Roland Schulz, repo-d...@googlegroups.com
2011/11/30 Douglas Alan <darkw...@gmail.com>
Did you try asking this question on the gerrit-trigger list ?
Are you using the latest version of this plugin ? Are you
running it on Jenkins or Hudson ?

--
Matthias

Matthias Sohn

unread,
Nov 30, 2011, 3:05:23 AM11/30/11
to Douglas Alan, Roland Schulz, repo-d...@googlegroups.com
2011/11/30 Matthias Sohn <matthi...@googlemail.com>
Try restarting the connection between gerrit-trigger plugin and Gerrit.
If this doesn't help try restarting Jenkins. 

--
Matthias

Douglas Alan

unread,
Nov 30, 2011, 1:46:43 PM11/30/11
to Repo and Gerrit Discussion
On Nov 30, 3:05 am, Matthias Sohn <matthias.s...@googlemail.com>
wrote:

> Try restarting the connection between gerrit-trigger plugin and Gerrit.
> If this doesn't help try restarting Jenkins.

I've tried all of those things, and many more. I've moved this
question to here:

http://groups.google.com/group/repo-discuss/browse_frm/thread/efb5286e993df62c?hl=en#

as I now have a great deal more evidence about what is causing the
problem.

|>ouglas

Reply all
Reply to author
Forward
0 new messages