0

Couldn't find any revision to build. Verify the repository and branch configuration for this job

Hi

I have created a new Jenkins pipeline project  and configured gitlab scm. I'm getting the error below when I run the job.    Last 4 lines of console output

> git rev-parse refs/remotes/origin/${BRANCH}^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/${BRANCH}^{commit} # timeout=10
> git rev-parse origin/${BRANCH}^{commit} # timeout=10
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
ERROR: Maximum checkout retry attempts reached, aborting
Finished: FAILURE

Could you please assist ?

 

1 comment

  • Avatar
    Owen Mehegan Official comment

    This issue is most likely caused by the BRANCH variable not being set. How are you triggering the job? If manually, that variable will not be set unless you have a parameter for the job named BRANCH and you enter something there when you trigger it.

    If you use the GitLab plugin to trigger builds from pushes to GitLab repos, you would want to use env.gitlabSourceBranch as the variable, rather than BRANCH, as documented here: https://github.com/jenkinsci/gitlab-plugin#pipeline-jobs

Please sign in to leave a comment.