Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: couldn't find any revision to build- Jenkins

Tags:

git

jenkins

I have a problem with some Jenkins pipelines: When I trigger them with old commits, I receive the following error:

git rev-parse e14aea3d252fc61f29ee7f41e623a78e0e0e5e47^{commit} # timeout=10
git rev-parse origin/e14aea3d252fc61f29ee7f41e623a78e0e0e5e47^{commit} # timeout=10
git rev-parse e14aea3d252fc61f29ee7f41e623a78e0e0e5e47^{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

screenshot:

In the example above, the commit is 5 months old. The pipeline receives 3 parameters: the repository name, branch name and commit sha1. I use Bitbucket as the repository hosting service.

This problem doesn't occur with newer commits (when I trigger the pipeline with commits from two months ago or from a few days ago, it works fine. Therefore, I think that the problem is not with Jenkins configuration. In addition, I verified that "shallow clone" and "lightweight checkout" options are not marked.)

Jenkins Configuration:

Configuration-part1 Configuration-part2

Does anybody have any ideas how to solve this?

like image 706
Shay Z Avatar asked Oct 24 '25 02:10

Shay Z


1 Answers

This can occur due to two issues:

  1. Branch name you have provided doesn't exists in the repo. Pls verify the branch name in the repo and give correct branch name.
  2. Branch exists and there are no latest changes committed in branch. You can simply touch any file and push the changes, it will automatically trigger the job.
like image 149
akash Avatar answered Oct 26 '25 18:10

akash