Getting "Couldn't find any revision to build" error while using Jenkins with BitBucket repository

5,767 views
Skip to first unread message

Saurabh Saxena

unread,
Jan 6, 2017, 4:53:37 PM1/6/17
to Jenkins Users
Hi All,

I am new to Jenkins and need your help with one of the error I am getting.

I have my local Jenkins setup with Tomcat, and have integrated it with BitBucket (Open Source) repository. While executing the build process I am getting the following error:

C:\Tools\PortableGit\git-bash.exe fetch --tags https://ssaxe...@bitbucket.org/ssaxena007/sk-test.git refs/remotes/origin/develop
Seen 0 remote branches
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
Finished: FAILURE

I googled the error however could not find any satisfactory answer to solve the issue.

Below are the details of my environment:

OS - Windows 7
Jenkins Version - 2.32.1 - Deployed locally on my machine with Tomcat 7.x
SCM Used - A private BitBucket repository from BitBucket.org
JDK - 1.8
Maven - 3.3.9
Git Client Used - gitbash.exe

Following are some of the links which I tried with no luck.

https://issues.jenkins-ci.org/browse/JENKINS-20502
https://issues.jenkins-ci.org/browse/JENKINS-35340
https://github.com/janinko/ghprb/issues/347
https://github.com/timols/jenkins-gitlab-merge-request-builder-plugin/issues/88

Could you please have a look into the issue details and let me know if I am doing anything wrong here.

Many thanks in advance for your suggestions

Best Regards,
-Saurabh


Mark Waite

unread,
Jan 6, 2017, 7:03:04 PM1/6/17
to jenkins...@googlegroups.com
Comments are inline.

Mark Waite

On Fri, Jan 6, 2017 at 2:53 PM Saurabh Saxena <saurabh....@gmail.com> wrote:
Hi All,

I am new to Jenkins and need your help with one of the error I am getting.

I have my local Jenkins setup with Tomcat, and have integrated it with BitBucket (Open Source) repository. While executing the build process I am getting the following error:

C:\Tools\PortableGit\git-bash.exe fetch --tags https://ssaxe...@bitbucket.org/ssaxena007/sk-test.git refs/remotes/origin/develop
Seen 0 remote branches
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
Finished: FAILURE

When my jobs run a git fetch, the command typically looks like:
git fetch --tags --progress https://github.com/MarkEWaite/jenkins-bugs.git +refs/heads/*:refs/remotes/origin/* 
Notice the significant difference in the final argument to the command.  I believe that is the "refspec" which defines the references which should be fetched from the remote repository to the local repository.  That refspec is usually set after clicking the "Advanced" button on the "Repositories" section of the job configuration.  You should probably not set a value for that refspec, or if you set a value, you need to review carefully that the value you set is correct for your repository.

I admit that I used git for multiple years before I ever used a custom refspec.  I use it more often now, but still need to refer to the online help to assure I have the correct syntax.

I googled the error however could not find any satisfactory answer to solve the issue. 

Below are the details of my environment:

OS - Windows 7
Jenkins Version - 2.32.1 - Deployed locally on my machine with Tomcat 7.x
SCM Used - A private BitBucket repository from BitBucket.org
JDK - 1.8
Maven - 3.3.9
Git Client Used - gitbash.exe

Following are some of the links which I tried with no luck.

https://issues.jenkins-ci.org/browse/JENKINS-20502
https://issues.jenkins-ci.org/browse/JENKINS-35340
https://github.com/janinko/ghprb/issues/347
https://github.com/timols/jenkins-gitlab-merge-request-builder-plugin/issues/88

Could you please have a look into the issue details and let me know if I am doing anything wrong here.

Many thanks in advance for your suggestions

Best Regards,
-Saurabh


--
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/66a939de-faf8-4caf-af19-045847ffade8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Amila Gunathilake

unread,
Feb 12, 2020, 9:43:56 AM2/12/20
to Jenkins Users

Capture.PNG

Hi Mr. Mark Waite,

I'm getting a same kind of issue when I created a Checkout stage with "refspec" and due to that my Pull request is failing, I cannot merge this in to my master branch.

Below is my checkout stage code for your reference. 




On Friday, January 6, 2017 at 4:53:37 PM UTC-5, Saurabh Saxena wrote:
Hi All,

I am new to Jenkins and need your help with one of the error I am getting.

I have my local Jenkins setup with Tomcat, and have integrated it with BitBucket (Open Source) repository. While executing the build process I am getting the following error:

C:\Tools\PortableGit\git-bash.exe fetch --tags https://ssaxena007@bitbucket.org/ssaxena007/sk-test.git refs/remotes/origin/develop
Seen 0 remote branches

Mark Waite

unread,
Feb 12, 2020, 11:21:48 AM2/12/20
to Jenkins Users
On Wed, Feb 12, 2020 at 7:43 AM Amila Gunathilake <amilag...@gmail.com> wrote:

Capture.PNG

Hi Mr. Mark Waite,

I'm getting a same kind of issue when I created a Checkout stage with "refspec" and due to that my Pull request is failing, I cannot merge this in to my master branch.


I don't see an obvious error in what you're trying, though I see some areas where it seems more complex than necessary.

For simplicity, try removing the refspec definition to see if that resolves the issue.  You might also try to remove the shallow clone to see if that helps with the issue.  You might also try using the branch name explicitly rather than using ${env.BRANCH_NAME}.
 
Below is my checkout stage code for your reference. 



On Friday, January 6, 2017 at 4:53:37 PM UTC-5, Saurabh Saxena wrote:
Hi All,

I am new to Jenkins and need your help with one of the error I am getting.

I have my local Jenkins setup with Tomcat, and have integrated it with BitBucket (Open Source) repository. While executing the build process I am getting the following error:

C:\Tools\PortableGit\git-bash.exe fetch --tags https://ssaxe...@bitbucket.org/ssaxena007/sk-test.git refs/remotes/origin/develop
Seen 0 remote branches
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
Finished: FAILURE

I googled the error however could not find any satisfactory answer to solve the issue.

Below are the details of my environment:

OS - Windows 7
Jenkins Version - 2.32.1 - Deployed locally on my machine with Tomcat 7.x
SCM Used - A private BitBucket repository from BitBucket.org
JDK - 1.8
Maven - 3.3.9
Git Client Used - gitbash.exe

Following are some of the links which I tried with no luck.

https://issues.jenkins-ci.org/browse/JENKINS-20502
https://issues.jenkins-ci.org/browse/JENKINS-35340
https://github.com/janinko/ghprb/issues/347
https://github.com/timols/jenkins-gitlab-merge-request-builder-plugin/issues/88

Could you please have a look into the issue details and let me know if I am doing anything wrong here.

Many thanks in advance for your suggestions

Best Regards,
-Saurabh

--
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.
Reply all
Reply to author
Forward
0 new messages