Getting "Couldn't find any revision to build" error with git checkout

23 views
Skip to first unread message

t3knoid

unread,
Mar 16, 2019, 12:15:51 PM3/16/19
to Jenkins Users
I have a new Jenkins server that has not used git for checking out. I tried using a simple git checkout, just using a freestyle project. For some reason I get a "Getting "Couldn't find any revision to build" whenever I try to check out. Using an older server checks out the same repo just fine...also using a new freestyle job.

Using the new server, I checked out something from github, and that worked fine. The server I am using is internal. It is using Bitbucket. I don't really think that should make a difference.

Mark Waite

unread,
Mar 16, 2019, 12:20:52 PM3/16/19
to Jenkins Users
That indicates command line git could not fit any reference that matches the branch name or SHA 1 it has been asked to build.  Some possible causes include:
  • Branch name has been requested that is not being fetched because the refspec in the "Advanced" section does not include the desired branch
  • Branch name to be built does not match any branch on the remote (typo in the branch name to be built)
Mark Waite

On Sat, Mar 16, 2019 at 10:16 AM t3knoid <t3k...@gmail.com> wrote:
I have a new Jenkins server that has not used git for checking out. I tried using a simple git checkout, just using a freestyle project. For some reason I get a "Getting "Couldn't find any revision to build" whenever I try to check out. Using an older server checks out the same repo just fine...also using a new freestyle job.

Using the new server, I checked out something from github, and that worked fine. The server I am using is internal. It is using Bitbucket. I don't really think that should make a difference.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/a70f0c42-f506-4ab0-b11c-42dd990db4d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Thanks!
Mark Waite

t3knoid

unread,
Mar 16, 2019, 3:47:41 PM3/16/19
to Jenkins Users
Thanks for your response.

> Branch name has been requested that is not being fetched because the refspec in the "Advanced" section does not include the desired branch

I'm not touching the Advanced section at all.

>Branch name to be built does not match any branch on the remote (typo in the branch name to be built)

I'm building the master branch. I've checked and double-checked the URL. As I said, when I do the same exact thing on a different Jenkins server, it works just fine.

Mark Waite

unread,
Mar 16, 2019, 4:02:13 PM3/16/19
to Jenkins Users
On Sat, Mar 16, 2019 at 1:47 PM t3knoid <t3k...@gmail.com> wrote:
Thanks for your response.

> Branch name has been requested that is not being fetched because the refspec in the "Advanced" section does not include the desired branch

I'm not touching the Advanced section at all.

>Branch name to be built does not match any branch on the remote (typo in the branch name to be built)

I'm building the master branch. I've checked and double-checked the URL. As I said, when I do the same exact thing on a different Jenkins server, it works just fine.


I'm out of ideas.  Submit a bug report with numbered steps that describe how to duplicate the bug.

Mark Waite
 

On Saturday, March 16, 2019 at 12:20:52 PM UTC-4, Mark Waite wrote:
That indicates command line git could not fit any reference that matches the branch name or SHA 1 it has been asked to build.  Some possible causes include:
  • Branch name has been requested that is not being fetched because the refspec in the "Advanced" section does not include the desired branch
  • Branch name to be built does not match any branch on the remote (typo in the branch name to be built)
Mark Waite

On Sat, Mar 16, 2019 at 10:16 AM t3knoid <t3k...@gmail.com> wrote:
I have a new Jenkins server that has not used git for checking out. I tried using a simple git checkout, just using a freestyle project. For some reason I get a "Getting "Couldn't find any revision to build" whenever I try to check out. Using an older server checks out the same repo just fine...also using a new freestyle job.

Using the new server, I checked out something from github, and that worked fine. The server I am using is internal. It is using Bitbucket. I don't really think that should make a difference.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/a70f0c42-f506-4ab0-b11c-42dd990db4d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Thanks!
Mark Waite

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
Thanks!
Mark Waite

t3knoid

unread,
Mar 16, 2019, 9:46:35 PM3/16/19
to Jenkins Users
Thanks for the suggestions anyway.

BTW, I downloaded Github desktop in the Jenkins slave machine and was able to clone without a problem.

Mark Waite

unread,
Mar 17, 2019, 12:45:06 AM3/17/19
to Jenkins Users
You might change into the workspace directory where the revision can't be found and look at the output of `git branch -a` and `git log`.  There may be some hint about something missing from the fetch.


For more options, visit https://groups.google.com/d/optout.


--
Thanks!
Mark Waite

t3knoid

unread,
Mar 18, 2019, 1:01:39 PM3/18/19
to Jenkins Users
I figured out why this was happening. It's user error :-). When installing git for windows, make sure to use "Use the native Windows Secure Channel library" option during installation.

Mark Waite

unread,
Mar 18, 2019, 2:02:52 PM3/18/19
to Jenkins Users
That's a very useful result.  Thanks for discovering it.  Would you be willing to put a note into the git plugin wiki page describing what you saw and how to resolve it?

We've had other surprises like that (credentials manager, for example), and the wiki page has been a good place to put the information until the time when the plugin finds a better way to prevent the problem or warn users about the problem.

Mark Waite

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
Thanks!
Mark Waite

t3knoid

unread,
Mar 18, 2019, 2:23:12 PM3/18/19
to Jenkins Users
Yeah sure. That's a good idea.

t3knoid

unread,
Mar 18, 2019, 3:05:55 PM3/18/19
to Jenkins Users
I added the following item: 
Git for Windows Installation and Windows Certificate Stores


On Monday, March 18, 2019 at 2:02:52 PM UTC-4, Mark Waite wrote:
Reply all
Reply to author
Forward
0 new messages