Gerrit Jenkins Trigger no longer has GERRIT_REFSPEC or other vars

2,173 views
Skip to first unread message

Mark Derricutt

unread,
May 17, 2016, 7:10:38 PM5/17/16
to Repo and Gerrit Discussion

Hey all,

Is anyone using Jenkins 2.3 with Gerrit Trigger 2.20.0 here yet? We upgraded the other day and everything seemed to be going fine but today I noticed we're now getting review build failures which seem to be due to no $GERRIT_REFSPEC or `$GERRIT_BRANCH, or $GERRIT_PATCHSET_REVISION environment variables being passed into the Jekins job to be built.

Same problem happens with 2.19.0 of the Gerrit Trigger plugin, we're running Gerrit 2.12.2 as well.

Cheers
Mark

ERROR: Error fetching remote repo 'gerrit'
hudson.plugins.git.GitException: Failed to fetch from http://gerrit.......
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:810)
    at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1066)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1097)
    at hudson.scm.SCM.checkout(SCM.java:485)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1269)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:607)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
    at hudson.model.Run.execute(Run.java:1738)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:410)
Caused by: hudson.plugins.git.GitException: Command "git -c core.askpass=true fetch --tags --progress http://gerrit.... $GERRIT_REFSPEC" returned status code 128:
stdout: 
stderr: fatal: Couldn't find remote ref $GERRIT_REFSPEC
Unexpected end of command stream

--
Mark Derricutt
http://www.theoryinpractice.net
http://www.chaliceofblood.net
http://plus.google.com/+MarkDerricutt
http://twitter.com/talios
http://facebook.com/mderricutt

signature.asc

Rob

unread,
May 17, 2016, 7:39:59 PM5/17/16
to Repo and Gerrit Discussion
see here:


and here:


Essentially, you want to add some stuff to JAVA_ARGS so it look like:

JAVA_ARGS="-Djava.awt.headless=true -Dhudson.model.ParametersAction.safeParameters=GERRIT_EVENT_TYPE,GERRIT_EVENT_HASH,GERRIT_BRANCH,GERRIT_TOPIC,GERRIT_CHANGE_NUMBER,GERRIT_CHANGE_ID,GERRIT_PATCHSET_NUMBER,GERRIT_PATCHSET_REVISION,GERRIT_REFSPEC,GERRIT_PROJECT,GERRIT_CHANGE_SUBJECT,GERRIT_CHANGE_COMMIT_MESSAGE,GERRIT_CHANGE_URL,GERRIT_CHANGE_OWNER,GERRIT_CHANGE_OWNER_NAME,GERRIT_CHANGE_OWNER_EMAIL,GERRIT_PATCHSET_UPLOADER,GERRIT_PATCHSET_UPLOADER_NAME"

in /etc/defaults/jenkins (on ubuntu)

Mark Derricutt

unread,
May 17, 2016, 8:11:19 PM5/17/16
to Rob, Repo and Gerrit Discussion
On 18 May 2016, at 11:39, Rob wrote:

> Essentially, you want to add some stuff to JAVA\_ARGS so it look like:

Cheers - got the same response on #jenkins a few minutes ago - all good. I assume a forthcoming version of the gerrit trigger plugin will pre-set these as safe?

Configs updated for now :)
signature.asc

David Pursehouse

unread,
May 18, 2016, 1:25:28 AM5/18/16
to Repo and Gerrit Discussion
On Wednesday, May 18, 2016 at 9:11:19 AM UTC+9, Mark Derricutt wrote:
On 18 May 2016, at 11:39, Rob wrote:

> Essentially, you want to add some stuff to JAVA\_ARGS so it look like:

Cheers - got the same response on #jenkins a few minutes ago - all good.  I assume a forthcoming version of the gerrit trigger plugin will pre-set these as safe?


The gerrit trigger plugin is not maintained by us.  There's already an issue raised on its issue tracker though [1], so at least Robert (the maintainer) knows about it.

Reply all
Reply to author
Forward
0 new messages