ghprb: git rev-parse ${sha1}^{commit}: ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.

Trying one of the latest versions and it is failing 😢

Versions

  • Jenkins 1.632
  • Plugins
    • GitHub: 1.14.0
    • GitHub API: 1.69
    • GitHub Pull Request Builder: 1.29
    • Credentials: 1.24
    • Plain Credentials: 1.1

ERROR

Started by timer
Building in workspace /var/lib/jenkins/jobs/BUILD-ISP-pull-requests/workspace
Wiping out workspace first.
Cloning the remote Git repository
Cloning repository https://github.intuit.com/servicesplatform-node/sp-quality
 > git init /var/lib/jenkins/jobs/BUILD-ISP-pull-requests/workspace # timeout=10
Fetching upstream changes from https://github.intuit.com/servicesplatform-node/sp-quality
 > git --version # timeout=10
using .gitcredentials to set credentials
 > git config --local credential.username mdesales # timeout=10
 > git config --local credential.helper store --file=/tmp/git5544296394853754862.credentials # timeout=10
 > git -c core.askpass=true fetch --tags --progress https://github.intuit.com/servicesplatform-node/sp-quality +refs/heads/*:refs/remotes/origin/*
 > git config --local --remove-section credential # timeout=10
 > git config remote.origin.url https://github.intuit.com/servicesplatform-node/sp-quality # timeout=10
 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git config remote.origin.url https://github.intuit.com/servicesplatform-node/sp-quality # timeout=10
Fetching upstream changes from https://github.intuit.com/servicesplatform-node/sp-quality
using .gitcredentials to set credentials
 > git config --local credential.username mdesales # timeout=10
 > git config --local credential.helper store --file=/tmp/git8157565619616801356.credentials # timeout=10
 > git -c core.askpass=true fetch --tags --progress https://github.intuit.com/servicesplatform-node/sp-quality +refs/pull/*:refs/remotes/origin/pr/*
 > git config --local --remove-section credential # timeout=10
 > git rev-parse origin/${sha1}^{commit} # timeout=10
 > git rev-parse ${sha1}^{commit} # timeout=10
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
Skipping Cobertura coverage report as build was not UNSTABLE or better ...
ERROR: Publisher 'Set build status on GitHub commit' aborted due to exception: 
java.io.IOException: Cannot determine sha1 of the commit. The status cannot be reported
    at org.jenkinsci.plugins.github.util.BuildDataHelper.getCommitSHA1(BuildDataHelper.java:38)
    at com.cloudbees.jenkins.GitHubCommitNotifier.updateCommitStatus(GitHubCommitNotifier.java:111)
    at com.cloudbees.jenkins.GitHubCommitNotifier.perform(GitHubCommitNotifier.java:90)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
    at hudson.model.Build$BuildExecution.post2(Build.java:185)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
    at hudson.model.Run.execute(Run.java:1766)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:408)
Started calculate disk usage of build
Finished Calculation of disk usage of build in 0 seconds
Started calculate disk usage of workspace
Finished Calculation of disk usage of workspace in 0 seconds
Finished: FAILURE

Jenkins Settings

I tested the following configuration…

screen shot 2015-10-15 at 5 03 56 pm

And Jenkins could successfully write to the Pull Request in our GitHub Enterprise

screen shot 2015-10-15 at 5 04 15 pm ## New Job Settings

I then setup the Jenkins job as described in the README.md… The GitHub Project URL is setup…

  • GitHub Project

screen shot 2015-10-15 at 5 10 36 pm

  • Source Code Management (Git)

screen shot 2015-10-15 at 5 10 53 pm

  • Build Triggers

screen shot 2015-10-15 at 5 11 18 pm

  • Build Environment (specific for Node.js projects)

screen shot 2015-10-15 at 5 11 29 pm

  • Error message…

This is the result of the Job… It cannot find the PR… 😦

screen shot 2015-10-15 at 5 25 53 pm

Please help!!!

thanks Marcello

About this issue

  • Original URL
  • State: open
  • Created 9 years ago
  • Reactions: 1
  • Comments: 30

Commits related to this issue

Most upvoted comments

We have the same issue. Since the upgrade all merge requests immediately fail with:

GitHub pull request #700 of commit 5bfc69338903769c094cd1b4caf95db71f4f5c57, no merge conflicts.
Baue auf Slave debian-stable-mm (jessie stable debian) in Arbeitsbereich /home/jenkins/workspace/workspace/elektra-mergerequests
[WS-CLEANUP] Deleting project workspace...
[WS-CLEANUP] Done
Cloning the remote Git repository
Cloning repository git://github.com/ElektraInitiative/libelektra.git
 > git init /home/jenkins/workspace/workspace/elektra-mergerequests # timeout=10
Fetching upstream changes from git://github.com/ElektraInitiative/libelektra.git
 > git --version # timeout=10
 > git -c core.askpass=true fetch --tags --progress git://github.com/ElektraInitiative/libelektra.git +refs/heads/*:refs/remotes/origin/*
 > git config remote.origin.url git://github.com/ElektraInitiative/libelektra.git # timeout=10
 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git config remote.origin.url git://github.com/ElektraInitiative/libelektra.git # timeout=10
Fetching upstream changes from git://github.com/ElektraInitiative/libelektra.git
 > git -c core.askpass=true fetch --tags --progress git://github.com/ElektraInitiative/libelektra.git +refs/pull/*:refs/remotes/origin/pr/*
 > git rev-parse origin/${sha1}^{commit} # timeout=10
 > git rev-parse ${sha1}^{commit} # timeout=10
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
[WARNINGS] Skipping publisher since build result is FAILURE
Archiviere Artefakte
SSH: Current build result is [FAILURE], not going to run.
Finished: FAILURE

This just started happening in our jenkins as well. not sure if anything (plugin or jenkins itself) was updated when it happened, but it seems like no.

@markus2330 see the fix described here, it worked for me: https://github.com/janinko/ghprb/issues/412#issuecomment-219096442

just make sure you use the write config setting to add the jvm args, it differs by linux distribution.

As @pulse00 says you have to update the plugin.

It worked for me.