jenkins on windows7. how to fix “couldn't find any revision to build?”

111 views
Skip to first unread message

Heidi Tseng

unread,
Mar 31, 2016, 8:31:48 AM3/31/16
to Jenkins Developers
I use git, gerrit, and jenkins as my CI system.
I can successfully push to gerrit ,review code on gerrit, and clone my remote git repository to local computer, but now I'm not able to build on jenkins. 

git and gerrit were installed on unbuntu, and jenkins was installed on windows (w7). 

Here is my Console Output:
Retriggered by user jenkinsw for Gerrit: http://10.10.55.34:8082/8 建置中 工作區 C:\Program Files (x86)\Jenkins\jobs\testw\workspace C:\Program Files\Git\git-bash.exe rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository > C:\Program Files\Git\git-bash.exe config remote.origin.url ssh://jenk...@10.10.55.34:29418/test.git # timeout=10 Fetching upstream changes from ssh://jenk...@10.10.55.34:29418/test.git C:\Program Files\Git\git-bash.exe --version # timeout=10 C:\Program Files\Git\git-bash.exe --version # timeout=10 C:\Program Files\Git\git-bash.exe fetch --tags ssh://jenk...@10.10.55.34:29418/test.git refs/changes/08/8/1 C:\Program Files\Git\git-bash.exe rev-parse "b8494ff5d3176890e85f4450de84e7031b909130^{commit}" # timeout=10 ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job. Finished: FAILURE

And I found that there is only a ".git" file in the workspace in my server computer! Shouldn't it clone what I push on gerrit?
Why is that? What should I do? or any else info I should put on? 

By the way, I tried  exactly the same setting by using another jenkins server which is installed on ubuntu, it works! 
Why can't I use these setting when on window?

hope you can help me!! thank you.

Mark Waite

unread,
Mar 31, 2016, 8:54:54 AM3/31/16
to Jenkins Developers
Often "Couldn't find any revision to build" hints that the definition of the branch to be built did not match any branches (or SHA1 hashes) in the repository.  In this case, is b8494ff5d3176890e85f4450de84e7031b909130 a valid SHA1 hash in the repository you're trying to clone?  That appears to be the only SHA1 hash that was trying to be built with this run of the job.

If the .git file is really a file (and not a directory), then that may indicate some other problem.  Usually .git is a directory, and contains the history of the repository.

I'm not a gerrit code review user, so I don't know details of gerrit configuration, but I'm reasonably confident there are many gerrit code review users running Jenkins.

Mark Waite

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/158e1c46-a3aa-472b-a358-524f722769d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Heidi Tseng

unread,
Mar 31, 2016, 9:33:35 AM3/31/16
to Jenkins Developers
thanks so much for answering, Mark. 
In my case, actally I don't know what  b8494ff5d3176890e85f4450de84e7031b909130 is... 
In the job config, I just put $GERRIT_BRANCH in "Branches to build"...

And I also want to ask that can I use jenkins server which is installed on ubuntu and run jobs on the other computer(win7) ?
because my project can only run on windows.
thank you!!

Mark Waite

unread,
Mar 31, 2016, 9:36:36 AM3/31/16
to Jenkins Developers
You can configure a slave on Windows that connects to the Jenkins server on Ubuntu.  It works quite well.

I would guess that GERRIT_BRANCH probably evaluated to that SHA1 (b8494...)

Mark Waite

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

Robert Sandell

unread,
Mar 31, 2016, 10:04:12 AM3/31/16
to jenkin...@googlegroups.com, jenkins...@googlegroups.com
This question belongs on the users list, so It's in the cc.

It's a bit hard to know what could be configured wrong without more info (and I'm not a windows user, so I don't know of any particulars on that OS) but;

Have you configured Gerrit Trigger as the build chooser for the git checkout? i.e. Additional Behaviours -> Strategy for choosing what to build -> Gerrit Trigger

After that configuring the branch is only nessesary to make the git plugin happy with something and can be used for for example merging to that branch before building.

Have you set the ref spec to $GERRIT_REFSPEC, it shouldn't be needed on newer versions of the plugin but just in case to make sure that you get the refs you should.

If you are using a replication server setup for Gerrit it might be that the ref hasn't been replicated yet to the slave that Jenkins is using when the build starts. You then either need to set the quiet period a bit higher or configure the job to wait for replication.

/Bobby


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



--
Robert Sandell
Software Engineer
CloudBees Inc.

Heidi Tseng

unread,
Mar 31, 2016, 10:32:12 AM3/31/16
to Jenkins Developers, jenkins...@googlegroups.com
thank you for answering Robert.
Yes, I use: Strategy for choosing what to build -> Gerrit Trigger
and I  set the ref spec to $GERRIT_REFSPEC, too.
I use these setting while using jenkins on ubuntu  works fine.
that's why i'm so confused why can't it run on windows...

Then I came up with another idea, that is to use jenkins on ubuntu, which works fine, and to make my code build on windows(another computer)
so what plugin should I use? SSH Plugin?
but according to jenkins wiki, it seems can be use on linux system only?

thank you guys so much for answering me!!

Robert Sandell於 2016年3月31日星期四 UTC+8下午10時04分12秒寫道:
Reply all
Reply to author
Forward
0 new messages