cberk1
cberk1

Reputation: 45

ERROR: Checkout failed on Jenkins Gerrit Trigger

I'm having some problems getting the Gerrit Trigger Jenkins plugin checking out my Gerrit project so was hoping for some help if possible!

I followed the instructions here.

Whilst my Jenkins job is successfully triggering using the Gerrit trigger, the git plugin is failing to check out the repository, giving this error in the console:

git fetch --tags --force --progress -- ssh://jenkins_user@:/software/ refs/heads/master # timeout=10 ERROR: Checkout failed java.lang.NullPointerException at com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser$GetGerritEventRevision.invoke(GerritTriggerBuildChooser.java:222) at com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser$GetGerritEventRevision.invoke(GerritTriggerBuildChooser.java:213) at hudson.plugins.git.GitSCM$BuildChooserContextImpl.actOnBuild(GitSCM.java:1066) at com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser.getCandidateRevisions(GerritTriggerBuildChooser.java:109) at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:1148) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1306) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:129) at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:159) at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:70) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:312) at hudson.model.ResourceController.execute(ResourceController.java:101) at hudson.model.Executor.run(Executor.java:442) ERROR: Maximum checkout retry attempts reached, aborting Finished: FAILURE

Troubleshooting:

  1. I can locally fetch and check out the repository (but not with the Gerrit change) on the Jenkins master. So, the credentials must be ok.
  2. In the Jenkins job->configuration->Git Plugin, if I change the 'Choosing Strategy' to 'Default' (and override the refspec and branch to not use the Gerrit ones), the checkout works.
  3. Following steps in the Gerrit trigger page, I've tried changing the refspec to 'refs/changes/:refs/changes/*' (this gives 'Specification is invalid.'), 'branch to build' to '*$GERRIT_REFSPEC', various combinations of empty values, hardcoded branches etc. all with no luck.
  4. I've ensured that the Gerrit Trigger, Git and Git Client plugins are up do date.
  5. Changing the 'Name' field to match another working Job I have which doesn't use Gerrit Trigger.
  6. Changing the repository URL to '$GERRIT_SCHEME://jenkins_user@$GERRIT_HOST:$GERRIT_PORT/$GERRIT_PROJECT' as advised in this

Jenkins version: Jenkins 2.401.1 Git plugin version: 5.2.0 Gerrit Trigger version: 2.39.1 Git client version: 4.5.0

Any ideas? Thanks!

Upvotes: 0

Views: 661

Answers (1)

cberk1
cberk1

Reputation: 45

So, as it turns out whilst I was troubleshooting I was triggering the build by changing the topic name. Whilst the plugin did indeed trigger, it didn't appear to pick up my tweaks. After forcing the trigger by uploading a new patchset, my corrections kicked in and it was ok.

Upvotes: 0

Related Questions